diff --git a/.gitignore b/.gitignore index 86f73cf1adfd6..97cfc3797f582 100644 --- a/.gitignore +++ b/.gitignore @@ -18,7 +18,7 @@ jspm_packages .node_repl_history *.tgz .yarn-integrity - +.DS_Store .vscode/launch.json lerna-debug.log diff --git a/clients/client-accessanalyzer/index.ts b/clients/client-accessanalyzer/index.ts index 81ecf061bfcec..83b590a60dbb8 100644 --- a/clients/client-accessanalyzer/index.ts +++ b/clients/client-accessanalyzer/index.ts @@ -9,13 +9,18 @@ export * from "./commands/GetAnalyzerCommand"; export * from "./commands/GetArchiveRuleCommand"; export * from "./commands/GetFindingCommand"; export * from "./commands/ListAnalyzedResourcesCommand"; +export * from "./pagination/ListAnalyzedResourcesPaginator"; export * from "./commands/ListAnalyzersCommand"; +export * from "./pagination/ListAnalyzersPaginator"; export * from "./commands/ListArchiveRulesCommand"; +export * from "./pagination/ListArchiveRulesPaginator"; export * from "./commands/ListFindingsCommand"; +export * from "./pagination/ListFindingsPaginator"; export * from "./commands/ListTagsForResourceCommand"; export * from "./commands/StartResourceScanCommand"; export * from "./commands/TagResourceCommand"; export * from "./commands/UntagResourceCommand"; export * from "./commands/UpdateArchiveRuleCommand"; export * from "./commands/UpdateFindingsCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-accessanalyzer/pagination/Interfaces.ts b/clients/client-accessanalyzer/pagination/Interfaces.ts new file mode 100644 index 0000000000000..e9b5d9e9bd304 --- /dev/null +++ b/clients/client-accessanalyzer/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { AccessAnalyzer } from "../AccessAnalyzer"; +import { AccessAnalyzerClient } from "../AccessAnalyzerClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface AccessAnalyzerPaginationConfiguration extends PaginationConfiguration { + client: AccessAnalyzer | AccessAnalyzerClient; +} diff --git a/clients/client-accessanalyzer/pagination/ListAnalyzedResourcesPaginator.ts b/clients/client-accessanalyzer/pagination/ListAnalyzedResourcesPaginator.ts new file mode 100644 index 0000000000000..399c1c365f00d --- /dev/null +++ b/clients/client-accessanalyzer/pagination/ListAnalyzedResourcesPaginator.ts @@ -0,0 +1,51 @@ +import { AccessAnalyzer } from "../AccessAnalyzer"; +import { AccessAnalyzerClient } from "../AccessAnalyzerClient"; +import { + ListAnalyzedResourcesCommand, + ListAnalyzedResourcesCommandInput, + ListAnalyzedResourcesCommandOutput, +} from "../commands/ListAnalyzedResourcesCommand"; +import { AccessAnalyzerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AccessAnalyzerClient, + input: ListAnalyzedResourcesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListAnalyzedResourcesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: AccessAnalyzer, + input: ListAnalyzedResourcesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listAnalyzedResources(input, ...args); +}; +export async function* listAnalyzedResourcesPaginate( + config: AccessAnalyzerPaginationConfiguration, + input: ListAnalyzedResourcesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListAnalyzedResourcesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof AccessAnalyzer) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AccessAnalyzerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected AccessAnalyzer | AccessAnalyzerClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-accessanalyzer/pagination/ListAnalyzersPaginator.ts b/clients/client-accessanalyzer/pagination/ListAnalyzersPaginator.ts new file mode 100644 index 0000000000000..3e51a2b3fc93c --- /dev/null +++ b/clients/client-accessanalyzer/pagination/ListAnalyzersPaginator.ts @@ -0,0 +1,51 @@ +import { AccessAnalyzer } from "../AccessAnalyzer"; +import { AccessAnalyzerClient } from "../AccessAnalyzerClient"; +import { + ListAnalyzersCommand, + ListAnalyzersCommandInput, + ListAnalyzersCommandOutput, +} from "../commands/ListAnalyzersCommand"; +import { AccessAnalyzerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AccessAnalyzerClient, + input: ListAnalyzersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListAnalyzersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: AccessAnalyzer, + input: ListAnalyzersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listAnalyzers(input, ...args); +}; +export async function* listAnalyzersPaginate( + config: AccessAnalyzerPaginationConfiguration, + input: ListAnalyzersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListAnalyzersCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof AccessAnalyzer) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AccessAnalyzerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected AccessAnalyzer | AccessAnalyzerClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-accessanalyzer/pagination/ListArchiveRulesPaginator.ts b/clients/client-accessanalyzer/pagination/ListArchiveRulesPaginator.ts new file mode 100644 index 0000000000000..d49d0a4c40caf --- /dev/null +++ b/clients/client-accessanalyzer/pagination/ListArchiveRulesPaginator.ts @@ -0,0 +1,51 @@ +import { AccessAnalyzer } from "../AccessAnalyzer"; +import { AccessAnalyzerClient } from "../AccessAnalyzerClient"; +import { + ListArchiveRulesCommand, + ListArchiveRulesCommandInput, + ListArchiveRulesCommandOutput, +} from "../commands/ListArchiveRulesCommand"; +import { AccessAnalyzerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AccessAnalyzerClient, + input: ListArchiveRulesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListArchiveRulesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: AccessAnalyzer, + input: ListArchiveRulesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listArchiveRules(input, ...args); +}; +export async function* listArchiveRulesPaginate( + config: AccessAnalyzerPaginationConfiguration, + input: ListArchiveRulesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListArchiveRulesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof AccessAnalyzer) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AccessAnalyzerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected AccessAnalyzer | AccessAnalyzerClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-accessanalyzer/pagination/ListFindingsPaginator.ts b/clients/client-accessanalyzer/pagination/ListFindingsPaginator.ts new file mode 100644 index 0000000000000..8f72a1ef43a91 --- /dev/null +++ b/clients/client-accessanalyzer/pagination/ListFindingsPaginator.ts @@ -0,0 +1,51 @@ +import { AccessAnalyzer } from "../AccessAnalyzer"; +import { AccessAnalyzerClient } from "../AccessAnalyzerClient"; +import { + ListFindingsCommand, + ListFindingsCommandInput, + ListFindingsCommandOutput, +} from "../commands/ListFindingsCommand"; +import { AccessAnalyzerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AccessAnalyzerClient, + input: ListFindingsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListFindingsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: AccessAnalyzer, + input: ListFindingsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listFindings(input, ...args); +}; +export async function* listFindingsPaginate( + config: AccessAnalyzerPaginationConfiguration, + input: ListFindingsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListFindingsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof AccessAnalyzer) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AccessAnalyzerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected AccessAnalyzer | AccessAnalyzerClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-acm-pca/index.ts b/clients/client-acm-pca/index.ts index ba2efc85bb79e..9d364adf078f2 100644 --- a/clients/client-acm-pca/index.ts +++ b/clients/client-acm-pca/index.ts @@ -13,11 +13,15 @@ export * from "./commands/GetCertificateAuthorityCsrCommand"; export * from "./commands/ImportCertificateAuthorityCertificateCommand"; export * from "./commands/IssueCertificateCommand"; export * from "./commands/ListCertificateAuthoritiesCommand"; +export * from "./pagination/ListCertificateAuthoritiesPaginator"; export * from "./commands/ListPermissionsCommand"; +export * from "./pagination/ListPermissionsPaginator"; export * from "./commands/ListTagsCommand"; +export * from "./pagination/ListTagsPaginator"; export * from "./commands/RestoreCertificateAuthorityCommand"; export * from "./commands/RevokeCertificateCommand"; export * from "./commands/TagCertificateAuthorityCommand"; export * from "./commands/UntagCertificateAuthorityCommand"; export * from "./commands/UpdateCertificateAuthorityCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-acm-pca/pagination/Interfaces.ts b/clients/client-acm-pca/pagination/Interfaces.ts new file mode 100644 index 0000000000000..24310a47d4f66 --- /dev/null +++ b/clients/client-acm-pca/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { ACMPCA } from "../ACMPCA"; +import { ACMPCAClient } from "../ACMPCAClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface ACMPCAPaginationConfiguration extends PaginationConfiguration { + client: ACMPCA | ACMPCAClient; +} diff --git a/clients/client-acm-pca/pagination/ListCertificateAuthoritiesPaginator.ts b/clients/client-acm-pca/pagination/ListCertificateAuthoritiesPaginator.ts new file mode 100644 index 0000000000000..e61eae34477b7 --- /dev/null +++ b/clients/client-acm-pca/pagination/ListCertificateAuthoritiesPaginator.ts @@ -0,0 +1,51 @@ +import { ACMPCA } from "../ACMPCA"; +import { ACMPCAClient } from "../ACMPCAClient"; +import { + ListCertificateAuthoritiesCommand, + ListCertificateAuthoritiesCommandInput, + ListCertificateAuthoritiesCommandOutput, +} from "../commands/ListCertificateAuthoritiesCommand"; +import { ACMPCAPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ACMPCAClient, + input: ListCertificateAuthoritiesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListCertificateAuthoritiesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ACMPCA, + input: ListCertificateAuthoritiesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listCertificateAuthorities(input, ...args); +}; +export async function* listCertificateAuthoritiesPaginate( + config: ACMPCAPaginationConfiguration, + input: ListCertificateAuthoritiesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListCertificateAuthoritiesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof ACMPCA) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ACMPCAClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ACMPCA | ACMPCAClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-acm-pca/pagination/ListPermissionsPaginator.ts b/clients/client-acm-pca/pagination/ListPermissionsPaginator.ts new file mode 100644 index 0000000000000..07510d198c0c0 --- /dev/null +++ b/clients/client-acm-pca/pagination/ListPermissionsPaginator.ts @@ -0,0 +1,51 @@ +import { ACMPCA } from "../ACMPCA"; +import { ACMPCAClient } from "../ACMPCAClient"; +import { + ListPermissionsCommand, + ListPermissionsCommandInput, + ListPermissionsCommandOutput, +} from "../commands/ListPermissionsCommand"; +import { ACMPCAPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ACMPCAClient, + input: ListPermissionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListPermissionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ACMPCA, + input: ListPermissionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listPermissions(input, ...args); +}; +export async function* listPermissionsPaginate( + config: ACMPCAPaginationConfiguration, + input: ListPermissionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListPermissionsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof ACMPCA) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ACMPCAClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ACMPCA | ACMPCAClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-acm-pca/pagination/ListTagsPaginator.ts b/clients/client-acm-pca/pagination/ListTagsPaginator.ts new file mode 100644 index 0000000000000..66de0e7b13b3f --- /dev/null +++ b/clients/client-acm-pca/pagination/ListTagsPaginator.ts @@ -0,0 +1,47 @@ +import { ACMPCA } from "../ACMPCA"; +import { ACMPCAClient } from "../ACMPCAClient"; +import { ListTagsCommand, ListTagsCommandInput, ListTagsCommandOutput } from "../commands/ListTagsCommand"; +import { ACMPCAPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ACMPCAClient, + input: ListTagsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTagsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ACMPCA, + input: ListTagsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTags(input, ...args); +}; +export async function* listTagsPaginate( + config: ACMPCAPaginationConfiguration, + input: ListTagsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTagsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof ACMPCA) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ACMPCAClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ACMPCA | ACMPCAClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-acm/index.ts b/clients/client-acm/index.ts index 305c2c00b758c..167d045d0cf6a 100644 --- a/clients/client-acm/index.ts +++ b/clients/client-acm/index.ts @@ -7,10 +7,12 @@ export * from "./commands/ExportCertificateCommand"; export * from "./commands/GetCertificateCommand"; export * from "./commands/ImportCertificateCommand"; export * from "./commands/ListCertificatesCommand"; +export * from "./pagination/ListCertificatesPaginator"; export * from "./commands/ListTagsForCertificateCommand"; export * from "./commands/RemoveTagsFromCertificateCommand"; export * from "./commands/RenewCertificateCommand"; export * from "./commands/RequestCertificateCommand"; export * from "./commands/ResendValidationEmailCommand"; export * from "./commands/UpdateCertificateOptionsCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-acm/pagination/Interfaces.ts b/clients/client-acm/pagination/Interfaces.ts new file mode 100644 index 0000000000000..7d89448e98d6a --- /dev/null +++ b/clients/client-acm/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { ACM } from "../ACM"; +import { ACMClient } from "../ACMClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface ACMPaginationConfiguration extends PaginationConfiguration { + client: ACM | ACMClient; +} diff --git a/clients/client-acm/pagination/ListCertificatesPaginator.ts b/clients/client-acm/pagination/ListCertificatesPaginator.ts new file mode 100644 index 0000000000000..afef8fa88ef69 --- /dev/null +++ b/clients/client-acm/pagination/ListCertificatesPaginator.ts @@ -0,0 +1,51 @@ +import { ACM } from "../ACM"; +import { ACMClient } from "../ACMClient"; +import { + ListCertificatesCommand, + ListCertificatesCommandInput, + ListCertificatesCommandOutput, +} from "../commands/ListCertificatesCommand"; +import { ACMPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ACMClient, + input: ListCertificatesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListCertificatesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ACM, + input: ListCertificatesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listCertificates(input, ...args); +}; +export async function* listCertificatesPaginate( + config: ACMPaginationConfiguration, + input: ListCertificatesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListCertificatesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxItems"] = config.pageSize; + if (config.client instanceof ACM) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ACMClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ACM | ACMClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-alexa-for-business/index.ts b/clients/client-alexa-for-business/index.ts index 9c6b9f5758a18..69e1dd3774b34 100644 --- a/clients/client-alexa-for-business/index.ts +++ b/clients/client-alexa-for-business/index.ts @@ -51,15 +51,25 @@ export * from "./commands/GetRoomCommand"; export * from "./commands/GetRoomSkillParameterCommand"; export * from "./commands/GetSkillGroupCommand"; export * from "./commands/ListBusinessReportSchedulesCommand"; +export * from "./pagination/ListBusinessReportSchedulesPaginator"; export * from "./commands/ListConferenceProvidersCommand"; +export * from "./pagination/ListConferenceProvidersPaginator"; export * from "./commands/ListDeviceEventsCommand"; +export * from "./pagination/ListDeviceEventsPaginator"; export * from "./commands/ListGatewayGroupsCommand"; +export * from "./pagination/ListGatewayGroupsPaginator"; export * from "./commands/ListGatewaysCommand"; +export * from "./pagination/ListGatewaysPaginator"; export * from "./commands/ListSkillsCommand"; +export * from "./pagination/ListSkillsPaginator"; export * from "./commands/ListSkillsStoreCategoriesCommand"; +export * from "./pagination/ListSkillsStoreCategoriesPaginator"; export * from "./commands/ListSkillsStoreSkillsByCategoryCommand"; +export * from "./pagination/ListSkillsStoreSkillsByCategoryPaginator"; export * from "./commands/ListSmartHomeAppliancesCommand"; +export * from "./pagination/ListSmartHomeAppliancesPaginator"; export * from "./commands/ListTagsCommand"; +export * from "./pagination/ListTagsPaginator"; export * from "./commands/PutConferencePreferenceCommand"; export * from "./commands/PutInvitationConfigurationCommand"; export * from "./commands/PutRoomSkillParameterCommand"; @@ -69,13 +79,21 @@ export * from "./commands/RejectSkillCommand"; export * from "./commands/ResolveRoomCommand"; export * from "./commands/RevokeInvitationCommand"; export * from "./commands/SearchAddressBooksCommand"; +export * from "./pagination/SearchAddressBooksPaginator"; export * from "./commands/SearchContactsCommand"; +export * from "./pagination/SearchContactsPaginator"; export * from "./commands/SearchDevicesCommand"; +export * from "./pagination/SearchDevicesPaginator"; export * from "./commands/SearchNetworkProfilesCommand"; +export * from "./pagination/SearchNetworkProfilesPaginator"; export * from "./commands/SearchProfilesCommand"; +export * from "./pagination/SearchProfilesPaginator"; export * from "./commands/SearchRoomsCommand"; +export * from "./pagination/SearchRoomsPaginator"; export * from "./commands/SearchSkillGroupsCommand"; +export * from "./pagination/SearchSkillGroupsPaginator"; export * from "./commands/SearchUsersCommand"; +export * from "./pagination/SearchUsersPaginator"; export * from "./commands/SendAnnouncementCommand"; export * from "./commands/SendInvitationCommand"; export * from "./commands/StartDeviceSyncCommand"; @@ -93,4 +111,5 @@ export * from "./commands/UpdateNetworkProfileCommand"; export * from "./commands/UpdateProfileCommand"; export * from "./commands/UpdateRoomCommand"; export * from "./commands/UpdateSkillGroupCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-alexa-for-business/pagination/Interfaces.ts b/clients/client-alexa-for-business/pagination/Interfaces.ts new file mode 100644 index 0000000000000..ec4e54412e7ef --- /dev/null +++ b/clients/client-alexa-for-business/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { AlexaForBusiness } from "../AlexaForBusiness"; +import { AlexaForBusinessClient } from "../AlexaForBusinessClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface AlexaForBusinessPaginationConfiguration extends PaginationConfiguration { + client: AlexaForBusiness | AlexaForBusinessClient; +} diff --git a/clients/client-alexa-for-business/pagination/ListBusinessReportSchedulesPaginator.ts b/clients/client-alexa-for-business/pagination/ListBusinessReportSchedulesPaginator.ts new file mode 100644 index 0000000000000..b2b0078cffb24 --- /dev/null +++ b/clients/client-alexa-for-business/pagination/ListBusinessReportSchedulesPaginator.ts @@ -0,0 +1,51 @@ +import { AlexaForBusiness } from "../AlexaForBusiness"; +import { AlexaForBusinessClient } from "../AlexaForBusinessClient"; +import { + ListBusinessReportSchedulesCommand, + ListBusinessReportSchedulesCommandInput, + ListBusinessReportSchedulesCommandOutput, +} from "../commands/ListBusinessReportSchedulesCommand"; +import { AlexaForBusinessPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AlexaForBusinessClient, + input: ListBusinessReportSchedulesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListBusinessReportSchedulesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: AlexaForBusiness, + input: ListBusinessReportSchedulesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listBusinessReportSchedules(input, ...args); +}; +export async function* listBusinessReportSchedulesPaginate( + config: AlexaForBusinessPaginationConfiguration, + input: ListBusinessReportSchedulesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListBusinessReportSchedulesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof AlexaForBusiness) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AlexaForBusinessClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-alexa-for-business/pagination/ListConferenceProvidersPaginator.ts b/clients/client-alexa-for-business/pagination/ListConferenceProvidersPaginator.ts new file mode 100644 index 0000000000000..6b549fbfc35a2 --- /dev/null +++ b/clients/client-alexa-for-business/pagination/ListConferenceProvidersPaginator.ts @@ -0,0 +1,51 @@ +import { AlexaForBusiness } from "../AlexaForBusiness"; +import { AlexaForBusinessClient } from "../AlexaForBusinessClient"; +import { + ListConferenceProvidersCommand, + ListConferenceProvidersCommandInput, + ListConferenceProvidersCommandOutput, +} from "../commands/ListConferenceProvidersCommand"; +import { AlexaForBusinessPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AlexaForBusinessClient, + input: ListConferenceProvidersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListConferenceProvidersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: AlexaForBusiness, + input: ListConferenceProvidersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listConferenceProviders(input, ...args); +}; +export async function* listConferenceProvidersPaginate( + config: AlexaForBusinessPaginationConfiguration, + input: ListConferenceProvidersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListConferenceProvidersCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof AlexaForBusiness) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AlexaForBusinessClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-alexa-for-business/pagination/ListDeviceEventsPaginator.ts b/clients/client-alexa-for-business/pagination/ListDeviceEventsPaginator.ts new file mode 100644 index 0000000000000..69b4651a8da53 --- /dev/null +++ b/clients/client-alexa-for-business/pagination/ListDeviceEventsPaginator.ts @@ -0,0 +1,51 @@ +import { AlexaForBusiness } from "../AlexaForBusiness"; +import { AlexaForBusinessClient } from "../AlexaForBusinessClient"; +import { + ListDeviceEventsCommand, + ListDeviceEventsCommandInput, + ListDeviceEventsCommandOutput, +} from "../commands/ListDeviceEventsCommand"; +import { AlexaForBusinessPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AlexaForBusinessClient, + input: ListDeviceEventsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDeviceEventsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: AlexaForBusiness, + input: ListDeviceEventsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDeviceEvents(input, ...args); +}; +export async function* listDeviceEventsPaginate( + config: AlexaForBusinessPaginationConfiguration, + input: ListDeviceEventsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDeviceEventsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof AlexaForBusiness) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AlexaForBusinessClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-alexa-for-business/pagination/ListGatewayGroupsPaginator.ts b/clients/client-alexa-for-business/pagination/ListGatewayGroupsPaginator.ts new file mode 100644 index 0000000000000..84f8b58037040 --- /dev/null +++ b/clients/client-alexa-for-business/pagination/ListGatewayGroupsPaginator.ts @@ -0,0 +1,51 @@ +import { AlexaForBusiness } from "../AlexaForBusiness"; +import { AlexaForBusinessClient } from "../AlexaForBusinessClient"; +import { + ListGatewayGroupsCommand, + ListGatewayGroupsCommandInput, + ListGatewayGroupsCommandOutput, +} from "../commands/ListGatewayGroupsCommand"; +import { AlexaForBusinessPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AlexaForBusinessClient, + input: ListGatewayGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListGatewayGroupsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: AlexaForBusiness, + input: ListGatewayGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listGatewayGroups(input, ...args); +}; +export async function* listGatewayGroupsPaginate( + config: AlexaForBusinessPaginationConfiguration, + input: ListGatewayGroupsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListGatewayGroupsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof AlexaForBusiness) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AlexaForBusinessClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-alexa-for-business/pagination/ListGatewaysPaginator.ts b/clients/client-alexa-for-business/pagination/ListGatewaysPaginator.ts new file mode 100644 index 0000000000000..1797267d934c7 --- /dev/null +++ b/clients/client-alexa-for-business/pagination/ListGatewaysPaginator.ts @@ -0,0 +1,51 @@ +import { AlexaForBusiness } from "../AlexaForBusiness"; +import { AlexaForBusinessClient } from "../AlexaForBusinessClient"; +import { + ListGatewaysCommand, + ListGatewaysCommandInput, + ListGatewaysCommandOutput, +} from "../commands/ListGatewaysCommand"; +import { AlexaForBusinessPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AlexaForBusinessClient, + input: ListGatewaysCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListGatewaysCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: AlexaForBusiness, + input: ListGatewaysCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listGateways(input, ...args); +}; +export async function* listGatewaysPaginate( + config: AlexaForBusinessPaginationConfiguration, + input: ListGatewaysCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListGatewaysCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof AlexaForBusiness) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AlexaForBusinessClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-alexa-for-business/pagination/ListSkillsPaginator.ts b/clients/client-alexa-for-business/pagination/ListSkillsPaginator.ts new file mode 100644 index 0000000000000..ed1ce7533b53d --- /dev/null +++ b/clients/client-alexa-for-business/pagination/ListSkillsPaginator.ts @@ -0,0 +1,47 @@ +import { AlexaForBusiness } from "../AlexaForBusiness"; +import { AlexaForBusinessClient } from "../AlexaForBusinessClient"; +import { ListSkillsCommand, ListSkillsCommandInput, ListSkillsCommandOutput } from "../commands/ListSkillsCommand"; +import { AlexaForBusinessPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AlexaForBusinessClient, + input: ListSkillsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListSkillsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: AlexaForBusiness, + input: ListSkillsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listSkills(input, ...args); +}; +export async function* listSkillsPaginate( + config: AlexaForBusinessPaginationConfiguration, + input: ListSkillsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListSkillsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof AlexaForBusiness) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AlexaForBusinessClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-alexa-for-business/pagination/ListSkillsStoreCategoriesPaginator.ts b/clients/client-alexa-for-business/pagination/ListSkillsStoreCategoriesPaginator.ts new file mode 100644 index 0000000000000..e5b9372fdb048 --- /dev/null +++ b/clients/client-alexa-for-business/pagination/ListSkillsStoreCategoriesPaginator.ts @@ -0,0 +1,51 @@ +import { AlexaForBusiness } from "../AlexaForBusiness"; +import { AlexaForBusinessClient } from "../AlexaForBusinessClient"; +import { + ListSkillsStoreCategoriesCommand, + ListSkillsStoreCategoriesCommandInput, + ListSkillsStoreCategoriesCommandOutput, +} from "../commands/ListSkillsStoreCategoriesCommand"; +import { AlexaForBusinessPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AlexaForBusinessClient, + input: ListSkillsStoreCategoriesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListSkillsStoreCategoriesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: AlexaForBusiness, + input: ListSkillsStoreCategoriesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listSkillsStoreCategories(input, ...args); +}; +export async function* listSkillsStoreCategoriesPaginate( + config: AlexaForBusinessPaginationConfiguration, + input: ListSkillsStoreCategoriesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListSkillsStoreCategoriesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof AlexaForBusiness) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AlexaForBusinessClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-alexa-for-business/pagination/ListSkillsStoreSkillsByCategoryPaginator.ts b/clients/client-alexa-for-business/pagination/ListSkillsStoreSkillsByCategoryPaginator.ts new file mode 100644 index 0000000000000..5c2ebb4bb4dbc --- /dev/null +++ b/clients/client-alexa-for-business/pagination/ListSkillsStoreSkillsByCategoryPaginator.ts @@ -0,0 +1,51 @@ +import { AlexaForBusiness } from "../AlexaForBusiness"; +import { AlexaForBusinessClient } from "../AlexaForBusinessClient"; +import { + ListSkillsStoreSkillsByCategoryCommand, + ListSkillsStoreSkillsByCategoryCommandInput, + ListSkillsStoreSkillsByCategoryCommandOutput, +} from "../commands/ListSkillsStoreSkillsByCategoryCommand"; +import { AlexaForBusinessPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AlexaForBusinessClient, + input: ListSkillsStoreSkillsByCategoryCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListSkillsStoreSkillsByCategoryCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: AlexaForBusiness, + input: ListSkillsStoreSkillsByCategoryCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listSkillsStoreSkillsByCategory(input, ...args); +}; +export async function* listSkillsStoreSkillsByCategoryPaginate( + config: AlexaForBusinessPaginationConfiguration, + input: ListSkillsStoreSkillsByCategoryCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListSkillsStoreSkillsByCategoryCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof AlexaForBusiness) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AlexaForBusinessClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-alexa-for-business/pagination/ListSmartHomeAppliancesPaginator.ts b/clients/client-alexa-for-business/pagination/ListSmartHomeAppliancesPaginator.ts new file mode 100644 index 0000000000000..265ebc5e7705a --- /dev/null +++ b/clients/client-alexa-for-business/pagination/ListSmartHomeAppliancesPaginator.ts @@ -0,0 +1,51 @@ +import { AlexaForBusiness } from "../AlexaForBusiness"; +import { AlexaForBusinessClient } from "../AlexaForBusinessClient"; +import { + ListSmartHomeAppliancesCommand, + ListSmartHomeAppliancesCommandInput, + ListSmartHomeAppliancesCommandOutput, +} from "../commands/ListSmartHomeAppliancesCommand"; +import { AlexaForBusinessPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AlexaForBusinessClient, + input: ListSmartHomeAppliancesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListSmartHomeAppliancesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: AlexaForBusiness, + input: ListSmartHomeAppliancesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listSmartHomeAppliances(input, ...args); +}; +export async function* listSmartHomeAppliancesPaginate( + config: AlexaForBusinessPaginationConfiguration, + input: ListSmartHomeAppliancesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListSmartHomeAppliancesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof AlexaForBusiness) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AlexaForBusinessClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-alexa-for-business/pagination/ListTagsPaginator.ts b/clients/client-alexa-for-business/pagination/ListTagsPaginator.ts new file mode 100644 index 0000000000000..e9ce149c44815 --- /dev/null +++ b/clients/client-alexa-for-business/pagination/ListTagsPaginator.ts @@ -0,0 +1,47 @@ +import { AlexaForBusiness } from "../AlexaForBusiness"; +import { AlexaForBusinessClient } from "../AlexaForBusinessClient"; +import { ListTagsCommand, ListTagsCommandInput, ListTagsCommandOutput } from "../commands/ListTagsCommand"; +import { AlexaForBusinessPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AlexaForBusinessClient, + input: ListTagsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTagsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: AlexaForBusiness, + input: ListTagsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTags(input, ...args); +}; +export async function* listTagsPaginate( + config: AlexaForBusinessPaginationConfiguration, + input: ListTagsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTagsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof AlexaForBusiness) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AlexaForBusinessClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-alexa-for-business/pagination/SearchAddressBooksPaginator.ts b/clients/client-alexa-for-business/pagination/SearchAddressBooksPaginator.ts new file mode 100644 index 0000000000000..bec747c928894 --- /dev/null +++ b/clients/client-alexa-for-business/pagination/SearchAddressBooksPaginator.ts @@ -0,0 +1,51 @@ +import { AlexaForBusiness } from "../AlexaForBusiness"; +import { AlexaForBusinessClient } from "../AlexaForBusinessClient"; +import { + SearchAddressBooksCommand, + SearchAddressBooksCommandInput, + SearchAddressBooksCommandOutput, +} from "../commands/SearchAddressBooksCommand"; +import { AlexaForBusinessPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AlexaForBusinessClient, + input: SearchAddressBooksCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new SearchAddressBooksCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: AlexaForBusiness, + input: SearchAddressBooksCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.searchAddressBooks(input, ...args); +}; +export async function* searchAddressBooksPaginate( + config: AlexaForBusinessPaginationConfiguration, + input: SearchAddressBooksCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: SearchAddressBooksCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof AlexaForBusiness) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AlexaForBusinessClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-alexa-for-business/pagination/SearchContactsPaginator.ts b/clients/client-alexa-for-business/pagination/SearchContactsPaginator.ts new file mode 100644 index 0000000000000..4ad14d528eaad --- /dev/null +++ b/clients/client-alexa-for-business/pagination/SearchContactsPaginator.ts @@ -0,0 +1,51 @@ +import { AlexaForBusiness } from "../AlexaForBusiness"; +import { AlexaForBusinessClient } from "../AlexaForBusinessClient"; +import { + SearchContactsCommand, + SearchContactsCommandInput, + SearchContactsCommandOutput, +} from "../commands/SearchContactsCommand"; +import { AlexaForBusinessPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AlexaForBusinessClient, + input: SearchContactsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new SearchContactsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: AlexaForBusiness, + input: SearchContactsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.searchContacts(input, ...args); +}; +export async function* searchContactsPaginate( + config: AlexaForBusinessPaginationConfiguration, + input: SearchContactsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: SearchContactsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof AlexaForBusiness) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AlexaForBusinessClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-alexa-for-business/pagination/SearchDevicesPaginator.ts b/clients/client-alexa-for-business/pagination/SearchDevicesPaginator.ts new file mode 100644 index 0000000000000..479a84f9384f6 --- /dev/null +++ b/clients/client-alexa-for-business/pagination/SearchDevicesPaginator.ts @@ -0,0 +1,51 @@ +import { AlexaForBusiness } from "../AlexaForBusiness"; +import { AlexaForBusinessClient } from "../AlexaForBusinessClient"; +import { + SearchDevicesCommand, + SearchDevicesCommandInput, + SearchDevicesCommandOutput, +} from "../commands/SearchDevicesCommand"; +import { AlexaForBusinessPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AlexaForBusinessClient, + input: SearchDevicesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new SearchDevicesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: AlexaForBusiness, + input: SearchDevicesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.searchDevices(input, ...args); +}; +export async function* searchDevicesPaginate( + config: AlexaForBusinessPaginationConfiguration, + input: SearchDevicesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: SearchDevicesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof AlexaForBusiness) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AlexaForBusinessClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-alexa-for-business/pagination/SearchNetworkProfilesPaginator.ts b/clients/client-alexa-for-business/pagination/SearchNetworkProfilesPaginator.ts new file mode 100644 index 0000000000000..dfc4972d92db5 --- /dev/null +++ b/clients/client-alexa-for-business/pagination/SearchNetworkProfilesPaginator.ts @@ -0,0 +1,51 @@ +import { AlexaForBusiness } from "../AlexaForBusiness"; +import { AlexaForBusinessClient } from "../AlexaForBusinessClient"; +import { + SearchNetworkProfilesCommand, + SearchNetworkProfilesCommandInput, + SearchNetworkProfilesCommandOutput, +} from "../commands/SearchNetworkProfilesCommand"; +import { AlexaForBusinessPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AlexaForBusinessClient, + input: SearchNetworkProfilesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new SearchNetworkProfilesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: AlexaForBusiness, + input: SearchNetworkProfilesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.searchNetworkProfiles(input, ...args); +}; +export async function* searchNetworkProfilesPaginate( + config: AlexaForBusinessPaginationConfiguration, + input: SearchNetworkProfilesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: SearchNetworkProfilesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof AlexaForBusiness) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AlexaForBusinessClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-alexa-for-business/pagination/SearchProfilesPaginator.ts b/clients/client-alexa-for-business/pagination/SearchProfilesPaginator.ts new file mode 100644 index 0000000000000..4be00e7d94f06 --- /dev/null +++ b/clients/client-alexa-for-business/pagination/SearchProfilesPaginator.ts @@ -0,0 +1,51 @@ +import { AlexaForBusiness } from "../AlexaForBusiness"; +import { AlexaForBusinessClient } from "../AlexaForBusinessClient"; +import { + SearchProfilesCommand, + SearchProfilesCommandInput, + SearchProfilesCommandOutput, +} from "../commands/SearchProfilesCommand"; +import { AlexaForBusinessPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AlexaForBusinessClient, + input: SearchProfilesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new SearchProfilesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: AlexaForBusiness, + input: SearchProfilesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.searchProfiles(input, ...args); +}; +export async function* searchProfilesPaginate( + config: AlexaForBusinessPaginationConfiguration, + input: SearchProfilesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: SearchProfilesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof AlexaForBusiness) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AlexaForBusinessClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-alexa-for-business/pagination/SearchRoomsPaginator.ts b/clients/client-alexa-for-business/pagination/SearchRoomsPaginator.ts new file mode 100644 index 0000000000000..c4a84a08bd765 --- /dev/null +++ b/clients/client-alexa-for-business/pagination/SearchRoomsPaginator.ts @@ -0,0 +1,47 @@ +import { AlexaForBusiness } from "../AlexaForBusiness"; +import { AlexaForBusinessClient } from "../AlexaForBusinessClient"; +import { SearchRoomsCommand, SearchRoomsCommandInput, SearchRoomsCommandOutput } from "../commands/SearchRoomsCommand"; +import { AlexaForBusinessPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AlexaForBusinessClient, + input: SearchRoomsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new SearchRoomsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: AlexaForBusiness, + input: SearchRoomsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.searchRooms(input, ...args); +}; +export async function* searchRoomsPaginate( + config: AlexaForBusinessPaginationConfiguration, + input: SearchRoomsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: SearchRoomsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof AlexaForBusiness) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AlexaForBusinessClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-alexa-for-business/pagination/SearchSkillGroupsPaginator.ts b/clients/client-alexa-for-business/pagination/SearchSkillGroupsPaginator.ts new file mode 100644 index 0000000000000..dbfe4f85e132f --- /dev/null +++ b/clients/client-alexa-for-business/pagination/SearchSkillGroupsPaginator.ts @@ -0,0 +1,51 @@ +import { AlexaForBusiness } from "../AlexaForBusiness"; +import { AlexaForBusinessClient } from "../AlexaForBusinessClient"; +import { + SearchSkillGroupsCommand, + SearchSkillGroupsCommandInput, + SearchSkillGroupsCommandOutput, +} from "../commands/SearchSkillGroupsCommand"; +import { AlexaForBusinessPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AlexaForBusinessClient, + input: SearchSkillGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new SearchSkillGroupsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: AlexaForBusiness, + input: SearchSkillGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.searchSkillGroups(input, ...args); +}; +export async function* searchSkillGroupsPaginate( + config: AlexaForBusinessPaginationConfiguration, + input: SearchSkillGroupsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: SearchSkillGroupsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof AlexaForBusiness) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AlexaForBusinessClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-alexa-for-business/pagination/SearchUsersPaginator.ts b/clients/client-alexa-for-business/pagination/SearchUsersPaginator.ts new file mode 100644 index 0000000000000..8b135db32bce2 --- /dev/null +++ b/clients/client-alexa-for-business/pagination/SearchUsersPaginator.ts @@ -0,0 +1,47 @@ +import { AlexaForBusiness } from "../AlexaForBusiness"; +import { AlexaForBusinessClient } from "../AlexaForBusinessClient"; +import { SearchUsersCommand, SearchUsersCommandInput, SearchUsersCommandOutput } from "../commands/SearchUsersCommand"; +import { AlexaForBusinessPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AlexaForBusinessClient, + input: SearchUsersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new SearchUsersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: AlexaForBusiness, + input: SearchUsersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.searchUsers(input, ...args); +}; +export async function* searchUsersPaginate( + config: AlexaForBusinessPaginationConfiguration, + input: SearchUsersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: SearchUsersCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof AlexaForBusiness) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AlexaForBusinessClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-app-mesh/index.ts b/clients/client-app-mesh/index.ts index a01244183f36f..7ab8a06affa07 100644 --- a/clients/client-app-mesh/index.ts +++ b/clients/client-app-mesh/index.ts @@ -18,11 +18,17 @@ export * from "./commands/DescribeVirtualRouterCommand"; export * from "./commands/DescribeVirtualServiceCommand"; export * from "./commands/GetMeshPolicyCommand"; export * from "./commands/ListMeshesCommand"; +export * from "./pagination/ListMeshesPaginator"; export * from "./commands/ListRoutesCommand"; +export * from "./pagination/ListRoutesPaginator"; export * from "./commands/ListTagsForResourceCommand"; +export * from "./pagination/ListTagsForResourcePaginator"; export * from "./commands/ListVirtualNodesCommand"; +export * from "./pagination/ListVirtualNodesPaginator"; export * from "./commands/ListVirtualRoutersCommand"; +export * from "./pagination/ListVirtualRoutersPaginator"; export * from "./commands/ListVirtualServicesCommand"; +export * from "./pagination/ListVirtualServicesPaginator"; export * from "./commands/PutMeshPolicyCommand"; export * from "./commands/TagResourceCommand"; export * from "./commands/UntagResourceCommand"; @@ -31,4 +37,5 @@ export * from "./commands/UpdateRouteCommand"; export * from "./commands/UpdateVirtualNodeCommand"; export * from "./commands/UpdateVirtualRouterCommand"; export * from "./commands/UpdateVirtualServiceCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-app-mesh/pagination/Interfaces.ts b/clients/client-app-mesh/pagination/Interfaces.ts new file mode 100644 index 0000000000000..a18930df6498d --- /dev/null +++ b/clients/client-app-mesh/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { AppMesh } from "../AppMesh"; +import { AppMeshClient } from "../AppMeshClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface AppMeshPaginationConfiguration extends PaginationConfiguration { + client: AppMesh | AppMeshClient; +} diff --git a/clients/client-app-mesh/pagination/ListMeshesPaginator.ts b/clients/client-app-mesh/pagination/ListMeshesPaginator.ts new file mode 100644 index 0000000000000..030f4cb54f211 --- /dev/null +++ b/clients/client-app-mesh/pagination/ListMeshesPaginator.ts @@ -0,0 +1,47 @@ +import { AppMesh } from "../AppMesh"; +import { AppMeshClient } from "../AppMeshClient"; +import { ListMeshesCommand, ListMeshesCommandInput, ListMeshesCommandOutput } from "../commands/ListMeshesCommand"; +import { AppMeshPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AppMeshClient, + input: ListMeshesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListMeshesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: AppMesh, + input: ListMeshesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listMeshes(input, ...args); +}; +export async function* listMeshesPaginate( + config: AppMeshPaginationConfiguration, + input: ListMeshesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListMeshesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["limit"] = config.pageSize; + if (config.client instanceof AppMesh) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AppMeshClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected AppMesh | AppMeshClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-app-mesh/pagination/ListRoutesPaginator.ts b/clients/client-app-mesh/pagination/ListRoutesPaginator.ts new file mode 100644 index 0000000000000..6810fe265401b --- /dev/null +++ b/clients/client-app-mesh/pagination/ListRoutesPaginator.ts @@ -0,0 +1,47 @@ +import { AppMesh } from "../AppMesh"; +import { AppMeshClient } from "../AppMeshClient"; +import { ListRoutesCommand, ListRoutesCommandInput, ListRoutesCommandOutput } from "../commands/ListRoutesCommand"; +import { AppMeshPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AppMeshClient, + input: ListRoutesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListRoutesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: AppMesh, + input: ListRoutesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listRoutes(input, ...args); +}; +export async function* listRoutesPaginate( + config: AppMeshPaginationConfiguration, + input: ListRoutesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListRoutesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["limit"] = config.pageSize; + if (config.client instanceof AppMesh) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AppMeshClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected AppMesh | AppMeshClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-app-mesh/pagination/ListTagsForResourcePaginator.ts b/clients/client-app-mesh/pagination/ListTagsForResourcePaginator.ts new file mode 100644 index 0000000000000..6ef9e4d62abae --- /dev/null +++ b/clients/client-app-mesh/pagination/ListTagsForResourcePaginator.ts @@ -0,0 +1,51 @@ +import { AppMesh } from "../AppMesh"; +import { AppMeshClient } from "../AppMeshClient"; +import { + ListTagsForResourceCommand, + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput, +} from "../commands/ListTagsForResourceCommand"; +import { AppMeshPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AppMeshClient, + input: ListTagsForResourceCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTagsForResourceCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: AppMesh, + input: ListTagsForResourceCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTagsForResource(input, ...args); +}; +export async function* listTagsForResourcePaginate( + config: AppMeshPaginationConfiguration, + input: ListTagsForResourceCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTagsForResourceCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["limit"] = config.pageSize; + if (config.client instanceof AppMesh) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AppMeshClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected AppMesh | AppMeshClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-app-mesh/pagination/ListVirtualNodesPaginator.ts b/clients/client-app-mesh/pagination/ListVirtualNodesPaginator.ts new file mode 100644 index 0000000000000..a431bbe9d3bc6 --- /dev/null +++ b/clients/client-app-mesh/pagination/ListVirtualNodesPaginator.ts @@ -0,0 +1,51 @@ +import { AppMesh } from "../AppMesh"; +import { AppMeshClient } from "../AppMeshClient"; +import { + ListVirtualNodesCommand, + ListVirtualNodesCommandInput, + ListVirtualNodesCommandOutput, +} from "../commands/ListVirtualNodesCommand"; +import { AppMeshPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AppMeshClient, + input: ListVirtualNodesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListVirtualNodesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: AppMesh, + input: ListVirtualNodesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listVirtualNodes(input, ...args); +}; +export async function* listVirtualNodesPaginate( + config: AppMeshPaginationConfiguration, + input: ListVirtualNodesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListVirtualNodesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["limit"] = config.pageSize; + if (config.client instanceof AppMesh) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AppMeshClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected AppMesh | AppMeshClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-app-mesh/pagination/ListVirtualRoutersPaginator.ts b/clients/client-app-mesh/pagination/ListVirtualRoutersPaginator.ts new file mode 100644 index 0000000000000..2934c994013d3 --- /dev/null +++ b/clients/client-app-mesh/pagination/ListVirtualRoutersPaginator.ts @@ -0,0 +1,51 @@ +import { AppMesh } from "../AppMesh"; +import { AppMeshClient } from "../AppMeshClient"; +import { + ListVirtualRoutersCommand, + ListVirtualRoutersCommandInput, + ListVirtualRoutersCommandOutput, +} from "../commands/ListVirtualRoutersCommand"; +import { AppMeshPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AppMeshClient, + input: ListVirtualRoutersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListVirtualRoutersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: AppMesh, + input: ListVirtualRoutersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listVirtualRouters(input, ...args); +}; +export async function* listVirtualRoutersPaginate( + config: AppMeshPaginationConfiguration, + input: ListVirtualRoutersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListVirtualRoutersCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["limit"] = config.pageSize; + if (config.client instanceof AppMesh) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AppMeshClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected AppMesh | AppMeshClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-app-mesh/pagination/ListVirtualServicesPaginator.ts b/clients/client-app-mesh/pagination/ListVirtualServicesPaginator.ts new file mode 100644 index 0000000000000..5cf5eed739a53 --- /dev/null +++ b/clients/client-app-mesh/pagination/ListVirtualServicesPaginator.ts @@ -0,0 +1,51 @@ +import { AppMesh } from "../AppMesh"; +import { AppMeshClient } from "../AppMeshClient"; +import { + ListVirtualServicesCommand, + ListVirtualServicesCommandInput, + ListVirtualServicesCommandOutput, +} from "../commands/ListVirtualServicesCommand"; +import { AppMeshPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AppMeshClient, + input: ListVirtualServicesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListVirtualServicesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: AppMesh, + input: ListVirtualServicesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listVirtualServices(input, ...args); +}; +export async function* listVirtualServicesPaginate( + config: AppMeshPaginationConfiguration, + input: ListVirtualServicesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListVirtualServicesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["limit"] = config.pageSize; + if (config.client instanceof AppMesh) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AppMeshClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected AppMesh | AppMeshClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-appconfig/index.ts b/clients/client-appconfig/index.ts index a639f53b6322d..443924b056260 100644 --- a/clients/client-appconfig/index.ts +++ b/clients/client-appconfig/index.ts @@ -18,11 +18,17 @@ export * from "./commands/GetDeploymentStrategyCommand"; export * from "./commands/GetEnvironmentCommand"; export * from "./commands/GetHostedConfigurationVersionCommand"; export * from "./commands/ListApplicationsCommand"; +export * from "./pagination/ListApplicationsPaginator"; export * from "./commands/ListConfigurationProfilesCommand"; +export * from "./pagination/ListConfigurationProfilesPaginator"; export * from "./commands/ListDeploymentsCommand"; +export * from "./pagination/ListDeploymentsPaginator"; export * from "./commands/ListDeploymentStrategiesCommand"; +export * from "./pagination/ListDeploymentStrategiesPaginator"; export * from "./commands/ListEnvironmentsCommand"; +export * from "./pagination/ListEnvironmentsPaginator"; export * from "./commands/ListHostedConfigurationVersionsCommand"; +export * from "./pagination/ListHostedConfigurationVersionsPaginator"; export * from "./commands/ListTagsForResourceCommand"; export * from "./commands/StartDeploymentCommand"; export * from "./commands/StopDeploymentCommand"; @@ -33,4 +39,5 @@ export * from "./commands/UpdateConfigurationProfileCommand"; export * from "./commands/UpdateDeploymentStrategyCommand"; export * from "./commands/UpdateEnvironmentCommand"; export * from "./commands/ValidateConfigurationCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-appconfig/pagination/Interfaces.ts b/clients/client-appconfig/pagination/Interfaces.ts new file mode 100644 index 0000000000000..57fd47001230a --- /dev/null +++ b/clients/client-appconfig/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { AppConfig } from "../AppConfig"; +import { AppConfigClient } from "../AppConfigClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface AppConfigPaginationConfiguration extends PaginationConfiguration { + client: AppConfig | AppConfigClient; +} diff --git a/clients/client-appconfig/pagination/ListApplicationsPaginator.ts b/clients/client-appconfig/pagination/ListApplicationsPaginator.ts new file mode 100644 index 0000000000000..3f07a830347b0 --- /dev/null +++ b/clients/client-appconfig/pagination/ListApplicationsPaginator.ts @@ -0,0 +1,51 @@ +import { AppConfig } from "../AppConfig"; +import { AppConfigClient } from "../AppConfigClient"; +import { + ListApplicationsCommand, + ListApplicationsCommandInput, + ListApplicationsCommandOutput, +} from "../commands/ListApplicationsCommand"; +import { AppConfigPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AppConfigClient, + input: ListApplicationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListApplicationsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: AppConfig, + input: ListApplicationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listApplications(input, ...args); +}; +export async function* listApplicationsPaginate( + config: AppConfigPaginationConfiguration, + input: ListApplicationsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListApplicationsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof AppConfig) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AppConfigClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected AppConfig | AppConfigClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-appconfig/pagination/ListConfigurationProfilesPaginator.ts b/clients/client-appconfig/pagination/ListConfigurationProfilesPaginator.ts new file mode 100644 index 0000000000000..29779b703ca11 --- /dev/null +++ b/clients/client-appconfig/pagination/ListConfigurationProfilesPaginator.ts @@ -0,0 +1,51 @@ +import { AppConfig } from "../AppConfig"; +import { AppConfigClient } from "../AppConfigClient"; +import { + ListConfigurationProfilesCommand, + ListConfigurationProfilesCommandInput, + ListConfigurationProfilesCommandOutput, +} from "../commands/ListConfigurationProfilesCommand"; +import { AppConfigPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AppConfigClient, + input: ListConfigurationProfilesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListConfigurationProfilesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: AppConfig, + input: ListConfigurationProfilesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listConfigurationProfiles(input, ...args); +}; +export async function* listConfigurationProfilesPaginate( + config: AppConfigPaginationConfiguration, + input: ListConfigurationProfilesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListConfigurationProfilesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof AppConfig) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AppConfigClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected AppConfig | AppConfigClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-appconfig/pagination/ListDeploymentStrategiesPaginator.ts b/clients/client-appconfig/pagination/ListDeploymentStrategiesPaginator.ts new file mode 100644 index 0000000000000..0bcd831422e2f --- /dev/null +++ b/clients/client-appconfig/pagination/ListDeploymentStrategiesPaginator.ts @@ -0,0 +1,51 @@ +import { AppConfig } from "../AppConfig"; +import { AppConfigClient } from "../AppConfigClient"; +import { + ListDeploymentStrategiesCommand, + ListDeploymentStrategiesCommandInput, + ListDeploymentStrategiesCommandOutput, +} from "../commands/ListDeploymentStrategiesCommand"; +import { AppConfigPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AppConfigClient, + input: ListDeploymentStrategiesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDeploymentStrategiesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: AppConfig, + input: ListDeploymentStrategiesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDeploymentStrategies(input, ...args); +}; +export async function* listDeploymentStrategiesPaginate( + config: AppConfigPaginationConfiguration, + input: ListDeploymentStrategiesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDeploymentStrategiesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof AppConfig) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AppConfigClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected AppConfig | AppConfigClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-appconfig/pagination/ListDeploymentsPaginator.ts b/clients/client-appconfig/pagination/ListDeploymentsPaginator.ts new file mode 100644 index 0000000000000..86949a659d3f7 --- /dev/null +++ b/clients/client-appconfig/pagination/ListDeploymentsPaginator.ts @@ -0,0 +1,51 @@ +import { AppConfig } from "../AppConfig"; +import { AppConfigClient } from "../AppConfigClient"; +import { + ListDeploymentsCommand, + ListDeploymentsCommandInput, + ListDeploymentsCommandOutput, +} from "../commands/ListDeploymentsCommand"; +import { AppConfigPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AppConfigClient, + input: ListDeploymentsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDeploymentsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: AppConfig, + input: ListDeploymentsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDeployments(input, ...args); +}; +export async function* listDeploymentsPaginate( + config: AppConfigPaginationConfiguration, + input: ListDeploymentsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDeploymentsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof AppConfig) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AppConfigClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected AppConfig | AppConfigClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-appconfig/pagination/ListEnvironmentsPaginator.ts b/clients/client-appconfig/pagination/ListEnvironmentsPaginator.ts new file mode 100644 index 0000000000000..56beff8923cbb --- /dev/null +++ b/clients/client-appconfig/pagination/ListEnvironmentsPaginator.ts @@ -0,0 +1,51 @@ +import { AppConfig } from "../AppConfig"; +import { AppConfigClient } from "../AppConfigClient"; +import { + ListEnvironmentsCommand, + ListEnvironmentsCommandInput, + ListEnvironmentsCommandOutput, +} from "../commands/ListEnvironmentsCommand"; +import { AppConfigPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AppConfigClient, + input: ListEnvironmentsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListEnvironmentsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: AppConfig, + input: ListEnvironmentsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listEnvironments(input, ...args); +}; +export async function* listEnvironmentsPaginate( + config: AppConfigPaginationConfiguration, + input: ListEnvironmentsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListEnvironmentsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof AppConfig) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AppConfigClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected AppConfig | AppConfigClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-appconfig/pagination/ListHostedConfigurationVersionsPaginator.ts b/clients/client-appconfig/pagination/ListHostedConfigurationVersionsPaginator.ts new file mode 100644 index 0000000000000..d6077864c4d92 --- /dev/null +++ b/clients/client-appconfig/pagination/ListHostedConfigurationVersionsPaginator.ts @@ -0,0 +1,51 @@ +import { AppConfig } from "../AppConfig"; +import { AppConfigClient } from "../AppConfigClient"; +import { + ListHostedConfigurationVersionsCommand, + ListHostedConfigurationVersionsCommandInput, + ListHostedConfigurationVersionsCommandOutput, +} from "../commands/ListHostedConfigurationVersionsCommand"; +import { AppConfigPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AppConfigClient, + input: ListHostedConfigurationVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListHostedConfigurationVersionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: AppConfig, + input: ListHostedConfigurationVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listHostedConfigurationVersions(input, ...args); +}; +export async function* listHostedConfigurationVersionsPaginate( + config: AppConfigPaginationConfiguration, + input: ListHostedConfigurationVersionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListHostedConfigurationVersionsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof AppConfig) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AppConfigClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected AppConfig | AppConfigClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-application-auto-scaling/index.ts b/clients/client-application-auto-scaling/index.ts index 57ffd53e3967d..70e80fd5a0228 100644 --- a/clients/client-application-auto-scaling/index.ts +++ b/clients/client-application-auto-scaling/index.ts @@ -4,10 +4,15 @@ export * from "./commands/DeleteScalingPolicyCommand"; export * from "./commands/DeleteScheduledActionCommand"; export * from "./commands/DeregisterScalableTargetCommand"; export * from "./commands/DescribeScalableTargetsCommand"; +export * from "./pagination/DescribeScalableTargetsPaginator"; export * from "./commands/DescribeScalingActivitiesCommand"; +export * from "./pagination/DescribeScalingActivitiesPaginator"; export * from "./commands/DescribeScalingPoliciesCommand"; +export * from "./pagination/DescribeScalingPoliciesPaginator"; export * from "./commands/DescribeScheduledActionsCommand"; +export * from "./pagination/DescribeScheduledActionsPaginator"; export * from "./commands/PutScalingPolicyCommand"; export * from "./commands/PutScheduledActionCommand"; export * from "./commands/RegisterScalableTargetCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-application-auto-scaling/pagination/DescribeScalableTargetsPaginator.ts b/clients/client-application-auto-scaling/pagination/DescribeScalableTargetsPaginator.ts new file mode 100644 index 0000000000000..0284aac2df4f6 --- /dev/null +++ b/clients/client-application-auto-scaling/pagination/DescribeScalableTargetsPaginator.ts @@ -0,0 +1,51 @@ +import { ApplicationAutoScaling } from "../ApplicationAutoScaling"; +import { ApplicationAutoScalingClient } from "../ApplicationAutoScalingClient"; +import { + DescribeScalableTargetsCommand, + DescribeScalableTargetsCommandInput, + DescribeScalableTargetsCommandOutput, +} from "../commands/DescribeScalableTargetsCommand"; +import { ApplicationAutoScalingPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ApplicationAutoScalingClient, + input: DescribeScalableTargetsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeScalableTargetsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ApplicationAutoScaling, + input: DescribeScalableTargetsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeScalableTargets(input, ...args); +}; +export async function* describeScalableTargetsPaginate( + config: ApplicationAutoScalingPaginationConfiguration, + input: DescribeScalableTargetsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeScalableTargetsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof ApplicationAutoScaling) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ApplicationAutoScalingClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ApplicationAutoScaling | ApplicationAutoScalingClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-application-auto-scaling/pagination/DescribeScalingActivitiesPaginator.ts b/clients/client-application-auto-scaling/pagination/DescribeScalingActivitiesPaginator.ts new file mode 100644 index 0000000000000..a9b42a8ebbde6 --- /dev/null +++ b/clients/client-application-auto-scaling/pagination/DescribeScalingActivitiesPaginator.ts @@ -0,0 +1,51 @@ +import { ApplicationAutoScaling } from "../ApplicationAutoScaling"; +import { ApplicationAutoScalingClient } from "../ApplicationAutoScalingClient"; +import { + DescribeScalingActivitiesCommand, + DescribeScalingActivitiesCommandInput, + DescribeScalingActivitiesCommandOutput, +} from "../commands/DescribeScalingActivitiesCommand"; +import { ApplicationAutoScalingPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ApplicationAutoScalingClient, + input: DescribeScalingActivitiesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeScalingActivitiesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ApplicationAutoScaling, + input: DescribeScalingActivitiesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeScalingActivities(input, ...args); +}; +export async function* describeScalingActivitiesPaginate( + config: ApplicationAutoScalingPaginationConfiguration, + input: DescribeScalingActivitiesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeScalingActivitiesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof ApplicationAutoScaling) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ApplicationAutoScalingClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ApplicationAutoScaling | ApplicationAutoScalingClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-application-auto-scaling/pagination/DescribeScalingPoliciesPaginator.ts b/clients/client-application-auto-scaling/pagination/DescribeScalingPoliciesPaginator.ts new file mode 100644 index 0000000000000..e57da092d5b77 --- /dev/null +++ b/clients/client-application-auto-scaling/pagination/DescribeScalingPoliciesPaginator.ts @@ -0,0 +1,51 @@ +import { ApplicationAutoScaling } from "../ApplicationAutoScaling"; +import { ApplicationAutoScalingClient } from "../ApplicationAutoScalingClient"; +import { + DescribeScalingPoliciesCommand, + DescribeScalingPoliciesCommandInput, + DescribeScalingPoliciesCommandOutput, +} from "../commands/DescribeScalingPoliciesCommand"; +import { ApplicationAutoScalingPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ApplicationAutoScalingClient, + input: DescribeScalingPoliciesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeScalingPoliciesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ApplicationAutoScaling, + input: DescribeScalingPoliciesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeScalingPolicies(input, ...args); +}; +export async function* describeScalingPoliciesPaginate( + config: ApplicationAutoScalingPaginationConfiguration, + input: DescribeScalingPoliciesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeScalingPoliciesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof ApplicationAutoScaling) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ApplicationAutoScalingClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ApplicationAutoScaling | ApplicationAutoScalingClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-application-auto-scaling/pagination/DescribeScheduledActionsPaginator.ts b/clients/client-application-auto-scaling/pagination/DescribeScheduledActionsPaginator.ts new file mode 100644 index 0000000000000..3037a8537badd --- /dev/null +++ b/clients/client-application-auto-scaling/pagination/DescribeScheduledActionsPaginator.ts @@ -0,0 +1,51 @@ +import { ApplicationAutoScaling } from "../ApplicationAutoScaling"; +import { ApplicationAutoScalingClient } from "../ApplicationAutoScalingClient"; +import { + DescribeScheduledActionsCommand, + DescribeScheduledActionsCommandInput, + DescribeScheduledActionsCommandOutput, +} from "../commands/DescribeScheduledActionsCommand"; +import { ApplicationAutoScalingPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ApplicationAutoScalingClient, + input: DescribeScheduledActionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeScheduledActionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ApplicationAutoScaling, + input: DescribeScheduledActionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeScheduledActions(input, ...args); +}; +export async function* describeScheduledActionsPaginate( + config: ApplicationAutoScalingPaginationConfiguration, + input: DescribeScheduledActionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeScheduledActionsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof ApplicationAutoScaling) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ApplicationAutoScalingClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ApplicationAutoScaling | ApplicationAutoScalingClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-application-auto-scaling/pagination/Interfaces.ts b/clients/client-application-auto-scaling/pagination/Interfaces.ts new file mode 100644 index 0000000000000..5704e741896a5 --- /dev/null +++ b/clients/client-application-auto-scaling/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { ApplicationAutoScaling } from "../ApplicationAutoScaling"; +import { ApplicationAutoScalingClient } from "../ApplicationAutoScalingClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface ApplicationAutoScalingPaginationConfiguration extends PaginationConfiguration { + client: ApplicationAutoScaling | ApplicationAutoScalingClient; +} diff --git a/clients/client-application-discovery-service/index.ts b/clients/client-application-discovery-service/index.ts index 5dc87c3224b44..eb6600be0c723 100644 --- a/clients/client-application-discovery-service/index.ts +++ b/clients/client-application-discovery-service/index.ts @@ -9,9 +9,11 @@ export * from "./commands/DeleteTagsCommand"; export * from "./commands/DescribeAgentsCommand"; export * from "./commands/DescribeConfigurationsCommand"; export * from "./commands/DescribeContinuousExportsCommand"; +export * from "./pagination/DescribeContinuousExportsPaginator"; export * from "./commands/DescribeExportConfigurationsCommand"; export * from "./commands/DescribeExportTasksCommand"; export * from "./commands/DescribeImportTasksCommand"; +export * from "./pagination/DescribeImportTasksPaginator"; export * from "./commands/DescribeTagsCommand"; export * from "./commands/DisassociateConfigurationItemsFromApplicationCommand"; export * from "./commands/ExportConfigurationsCommand"; @@ -25,4 +27,5 @@ export * from "./commands/StartImportTaskCommand"; export * from "./commands/StopContinuousExportCommand"; export * from "./commands/StopDataCollectionByAgentIdsCommand"; export * from "./commands/UpdateApplicationCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-application-discovery-service/pagination/DescribeContinuousExportsPaginator.ts b/clients/client-application-discovery-service/pagination/DescribeContinuousExportsPaginator.ts new file mode 100644 index 0000000000000..cc2394d0e9a7e --- /dev/null +++ b/clients/client-application-discovery-service/pagination/DescribeContinuousExportsPaginator.ts @@ -0,0 +1,51 @@ +import { ApplicationDiscoveryService } from "../ApplicationDiscoveryService"; +import { ApplicationDiscoveryServiceClient } from "../ApplicationDiscoveryServiceClient"; +import { + DescribeContinuousExportsCommand, + DescribeContinuousExportsCommandInput, + DescribeContinuousExportsCommandOutput, +} from "../commands/DescribeContinuousExportsCommand"; +import { ApplicationDiscoveryServicePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ApplicationDiscoveryServiceClient, + input: DescribeContinuousExportsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeContinuousExportsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ApplicationDiscoveryService, + input: DescribeContinuousExportsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeContinuousExports(input, ...args); +}; +export async function* describeContinuousExportsPaginate( + config: ApplicationDiscoveryServicePaginationConfiguration, + input: DescribeContinuousExportsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeContinuousExportsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof ApplicationDiscoveryService) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ApplicationDiscoveryServiceClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ApplicationDiscoveryService | ApplicationDiscoveryServiceClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-application-discovery-service/pagination/DescribeImportTasksPaginator.ts b/clients/client-application-discovery-service/pagination/DescribeImportTasksPaginator.ts new file mode 100644 index 0000000000000..2437bbe5c5a31 --- /dev/null +++ b/clients/client-application-discovery-service/pagination/DescribeImportTasksPaginator.ts @@ -0,0 +1,51 @@ +import { ApplicationDiscoveryService } from "../ApplicationDiscoveryService"; +import { ApplicationDiscoveryServiceClient } from "../ApplicationDiscoveryServiceClient"; +import { + DescribeImportTasksCommand, + DescribeImportTasksCommandInput, + DescribeImportTasksCommandOutput, +} from "../commands/DescribeImportTasksCommand"; +import { ApplicationDiscoveryServicePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ApplicationDiscoveryServiceClient, + input: DescribeImportTasksCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeImportTasksCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ApplicationDiscoveryService, + input: DescribeImportTasksCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeImportTasks(input, ...args); +}; +export async function* describeImportTasksPaginate( + config: ApplicationDiscoveryServicePaginationConfiguration, + input: DescribeImportTasksCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeImportTasksCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof ApplicationDiscoveryService) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ApplicationDiscoveryServiceClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ApplicationDiscoveryService | ApplicationDiscoveryServiceClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-application-discovery-service/pagination/Interfaces.ts b/clients/client-application-discovery-service/pagination/Interfaces.ts new file mode 100644 index 0000000000000..6dab37288abee --- /dev/null +++ b/clients/client-application-discovery-service/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { ApplicationDiscoveryService } from "../ApplicationDiscoveryService"; +import { ApplicationDiscoveryServiceClient } from "../ApplicationDiscoveryServiceClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface ApplicationDiscoveryServicePaginationConfiguration extends PaginationConfiguration { + client: ApplicationDiscoveryService | ApplicationDiscoveryServiceClient; +} diff --git a/clients/client-application-insights/index.ts b/clients/client-application-insights/index.ts index 561574260f447..fd3613f2380ae 100644 --- a/clients/client-application-insights/index.ts +++ b/clients/client-application-insights/index.ts @@ -15,11 +15,17 @@ export * from "./commands/DescribeObservationCommand"; export * from "./commands/DescribeProblemCommand"; export * from "./commands/DescribeProblemObservationsCommand"; export * from "./commands/ListApplicationsCommand"; +export * from "./pagination/ListApplicationsPaginator"; export * from "./commands/ListComponentsCommand"; +export * from "./pagination/ListComponentsPaginator"; export * from "./commands/ListConfigurationHistoryCommand"; +export * from "./pagination/ListConfigurationHistoryPaginator"; export * from "./commands/ListLogPatternsCommand"; +export * from "./pagination/ListLogPatternsPaginator"; export * from "./commands/ListLogPatternSetsCommand"; +export * from "./pagination/ListLogPatternSetsPaginator"; export * from "./commands/ListProblemsCommand"; +export * from "./pagination/ListProblemsPaginator"; export * from "./commands/ListTagsForResourceCommand"; export * from "./commands/TagResourceCommand"; export * from "./commands/UntagResourceCommand"; @@ -27,4 +33,5 @@ export * from "./commands/UpdateApplicationCommand"; export * from "./commands/UpdateComponentCommand"; export * from "./commands/UpdateComponentConfigurationCommand"; export * from "./commands/UpdateLogPatternCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-application-insights/pagination/Interfaces.ts b/clients/client-application-insights/pagination/Interfaces.ts new file mode 100644 index 0000000000000..8751ad85ee0d6 --- /dev/null +++ b/clients/client-application-insights/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { ApplicationInsights } from "../ApplicationInsights"; +import { ApplicationInsightsClient } from "../ApplicationInsightsClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface ApplicationInsightsPaginationConfiguration extends PaginationConfiguration { + client: ApplicationInsights | ApplicationInsightsClient; +} diff --git a/clients/client-application-insights/pagination/ListApplicationsPaginator.ts b/clients/client-application-insights/pagination/ListApplicationsPaginator.ts new file mode 100644 index 0000000000000..5e1ac7fea0c0f --- /dev/null +++ b/clients/client-application-insights/pagination/ListApplicationsPaginator.ts @@ -0,0 +1,51 @@ +import { ApplicationInsights } from "../ApplicationInsights"; +import { ApplicationInsightsClient } from "../ApplicationInsightsClient"; +import { + ListApplicationsCommand, + ListApplicationsCommandInput, + ListApplicationsCommandOutput, +} from "../commands/ListApplicationsCommand"; +import { ApplicationInsightsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ApplicationInsightsClient, + input: ListApplicationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListApplicationsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ApplicationInsights, + input: ListApplicationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listApplications(input, ...args); +}; +export async function* listApplicationsPaginate( + config: ApplicationInsightsPaginationConfiguration, + input: ListApplicationsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListApplicationsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof ApplicationInsights) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ApplicationInsightsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ApplicationInsights | ApplicationInsightsClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-application-insights/pagination/ListComponentsPaginator.ts b/clients/client-application-insights/pagination/ListComponentsPaginator.ts new file mode 100644 index 0000000000000..80ee3460d4543 --- /dev/null +++ b/clients/client-application-insights/pagination/ListComponentsPaginator.ts @@ -0,0 +1,51 @@ +import { ApplicationInsights } from "../ApplicationInsights"; +import { ApplicationInsightsClient } from "../ApplicationInsightsClient"; +import { + ListComponentsCommand, + ListComponentsCommandInput, + ListComponentsCommandOutput, +} from "../commands/ListComponentsCommand"; +import { ApplicationInsightsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ApplicationInsightsClient, + input: ListComponentsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListComponentsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ApplicationInsights, + input: ListComponentsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listComponents(input, ...args); +}; +export async function* listComponentsPaginate( + config: ApplicationInsightsPaginationConfiguration, + input: ListComponentsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListComponentsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof ApplicationInsights) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ApplicationInsightsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ApplicationInsights | ApplicationInsightsClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-application-insights/pagination/ListConfigurationHistoryPaginator.ts b/clients/client-application-insights/pagination/ListConfigurationHistoryPaginator.ts new file mode 100644 index 0000000000000..fe18e85f4704a --- /dev/null +++ b/clients/client-application-insights/pagination/ListConfigurationHistoryPaginator.ts @@ -0,0 +1,51 @@ +import { ApplicationInsights } from "../ApplicationInsights"; +import { ApplicationInsightsClient } from "../ApplicationInsightsClient"; +import { + ListConfigurationHistoryCommand, + ListConfigurationHistoryCommandInput, + ListConfigurationHistoryCommandOutput, +} from "../commands/ListConfigurationHistoryCommand"; +import { ApplicationInsightsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ApplicationInsightsClient, + input: ListConfigurationHistoryCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListConfigurationHistoryCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ApplicationInsights, + input: ListConfigurationHistoryCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listConfigurationHistory(input, ...args); +}; +export async function* listConfigurationHistoryPaginate( + config: ApplicationInsightsPaginationConfiguration, + input: ListConfigurationHistoryCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListConfigurationHistoryCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof ApplicationInsights) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ApplicationInsightsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ApplicationInsights | ApplicationInsightsClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-application-insights/pagination/ListLogPatternSetsPaginator.ts b/clients/client-application-insights/pagination/ListLogPatternSetsPaginator.ts new file mode 100644 index 0000000000000..13a0aedca7bff --- /dev/null +++ b/clients/client-application-insights/pagination/ListLogPatternSetsPaginator.ts @@ -0,0 +1,51 @@ +import { ApplicationInsights } from "../ApplicationInsights"; +import { ApplicationInsightsClient } from "../ApplicationInsightsClient"; +import { + ListLogPatternSetsCommand, + ListLogPatternSetsCommandInput, + ListLogPatternSetsCommandOutput, +} from "../commands/ListLogPatternSetsCommand"; +import { ApplicationInsightsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ApplicationInsightsClient, + input: ListLogPatternSetsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListLogPatternSetsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ApplicationInsights, + input: ListLogPatternSetsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listLogPatternSets(input, ...args); +}; +export async function* listLogPatternSetsPaginate( + config: ApplicationInsightsPaginationConfiguration, + input: ListLogPatternSetsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListLogPatternSetsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof ApplicationInsights) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ApplicationInsightsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ApplicationInsights | ApplicationInsightsClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-application-insights/pagination/ListLogPatternsPaginator.ts b/clients/client-application-insights/pagination/ListLogPatternsPaginator.ts new file mode 100644 index 0000000000000..c862bc52762c2 --- /dev/null +++ b/clients/client-application-insights/pagination/ListLogPatternsPaginator.ts @@ -0,0 +1,51 @@ +import { ApplicationInsights } from "../ApplicationInsights"; +import { ApplicationInsightsClient } from "../ApplicationInsightsClient"; +import { + ListLogPatternsCommand, + ListLogPatternsCommandInput, + ListLogPatternsCommandOutput, +} from "../commands/ListLogPatternsCommand"; +import { ApplicationInsightsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ApplicationInsightsClient, + input: ListLogPatternsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListLogPatternsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ApplicationInsights, + input: ListLogPatternsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listLogPatterns(input, ...args); +}; +export async function* listLogPatternsPaginate( + config: ApplicationInsightsPaginationConfiguration, + input: ListLogPatternsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListLogPatternsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof ApplicationInsights) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ApplicationInsightsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ApplicationInsights | ApplicationInsightsClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-application-insights/pagination/ListProblemsPaginator.ts b/clients/client-application-insights/pagination/ListProblemsPaginator.ts new file mode 100644 index 0000000000000..37cb2e402d89a --- /dev/null +++ b/clients/client-application-insights/pagination/ListProblemsPaginator.ts @@ -0,0 +1,51 @@ +import { ApplicationInsights } from "../ApplicationInsights"; +import { ApplicationInsightsClient } from "../ApplicationInsightsClient"; +import { + ListProblemsCommand, + ListProblemsCommandInput, + ListProblemsCommandOutput, +} from "../commands/ListProblemsCommand"; +import { ApplicationInsightsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ApplicationInsightsClient, + input: ListProblemsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListProblemsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ApplicationInsights, + input: ListProblemsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listProblems(input, ...args); +}; +export async function* listProblemsPaginate( + config: ApplicationInsightsPaginationConfiguration, + input: ListProblemsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListProblemsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof ApplicationInsights) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ApplicationInsightsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ApplicationInsights | ApplicationInsightsClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-appstream/index.ts b/clients/client-appstream/index.ts index 1c45c13270285..8eb35f1cf83f0 100644 --- a/clients/client-appstream/index.ts +++ b/clients/client-appstream/index.ts @@ -24,7 +24,9 @@ export * from "./commands/DescribeDirectoryConfigsCommand"; export * from "./commands/DescribeFleetsCommand"; export * from "./commands/DescribeImageBuildersCommand"; export * from "./commands/DescribeImagePermissionsCommand"; +export * from "./pagination/DescribeImagePermissionsPaginator"; export * from "./commands/DescribeImagesCommand"; +export * from "./pagination/DescribeImagesPaginator"; export * from "./commands/DescribeSessionsCommand"; export * from "./commands/DescribeStacksCommand"; export * from "./commands/DescribeUsageReportSubscriptionsCommand"; @@ -47,4 +49,5 @@ export * from "./commands/UpdateDirectoryConfigCommand"; export * from "./commands/UpdateFleetCommand"; export * from "./commands/UpdateImagePermissionsCommand"; export * from "./commands/UpdateStackCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-appstream/pagination/DescribeImagePermissionsPaginator.ts b/clients/client-appstream/pagination/DescribeImagePermissionsPaginator.ts new file mode 100644 index 0000000000000..bcc7f9bdce47e --- /dev/null +++ b/clients/client-appstream/pagination/DescribeImagePermissionsPaginator.ts @@ -0,0 +1,51 @@ +import { AppStream } from "../AppStream"; +import { AppStreamClient } from "../AppStreamClient"; +import { + DescribeImagePermissionsCommand, + DescribeImagePermissionsCommandInput, + DescribeImagePermissionsCommandOutput, +} from "../commands/DescribeImagePermissionsCommand"; +import { AppStreamPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AppStreamClient, + input: DescribeImagePermissionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeImagePermissionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: AppStream, + input: DescribeImagePermissionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeImagePermissions(input, ...args); +}; +export async function* describeImagePermissionsPaginate( + config: AppStreamPaginationConfiguration, + input: DescribeImagePermissionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeImagePermissionsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof AppStream) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AppStreamClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected AppStream | AppStreamClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-appstream/pagination/DescribeImagesPaginator.ts b/clients/client-appstream/pagination/DescribeImagesPaginator.ts new file mode 100644 index 0000000000000..904420f2a1e8c --- /dev/null +++ b/clients/client-appstream/pagination/DescribeImagesPaginator.ts @@ -0,0 +1,51 @@ +import { AppStream } from "../AppStream"; +import { AppStreamClient } from "../AppStreamClient"; +import { + DescribeImagesCommand, + DescribeImagesCommandInput, + DescribeImagesCommandOutput, +} from "../commands/DescribeImagesCommand"; +import { AppStreamPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AppStreamClient, + input: DescribeImagesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeImagesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: AppStream, + input: DescribeImagesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeImages(input, ...args); +}; +export async function* describeImagesPaginate( + config: AppStreamPaginationConfiguration, + input: DescribeImagesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeImagesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof AppStream) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AppStreamClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected AppStream | AppStreamClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-appstream/pagination/Interfaces.ts b/clients/client-appstream/pagination/Interfaces.ts new file mode 100644 index 0000000000000..f61046d805920 --- /dev/null +++ b/clients/client-appstream/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { AppStream } from "../AppStream"; +import { AppStreamClient } from "../AppStreamClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface AppStreamPaginationConfiguration extends PaginationConfiguration { + client: AppStream | AppStreamClient; +} diff --git a/clients/client-athena/index.ts b/clients/client-athena/index.ts index 3a10146222b10..a1cef59226bac 100644 --- a/clients/client-athena/index.ts +++ b/clients/client-athena/index.ts @@ -13,19 +13,28 @@ export * from "./commands/GetDataCatalogCommand"; export * from "./commands/GetNamedQueryCommand"; export * from "./commands/GetQueryExecutionCommand"; export * from "./commands/GetQueryResultsCommand"; +export * from "./pagination/GetQueryResultsPaginator"; export * from "./commands/GetTableMetadataCommand"; export * from "./commands/GetWorkGroupCommand"; export * from "./commands/ListDatabasesCommand"; +export * from "./pagination/ListDatabasesPaginator"; export * from "./commands/ListDataCatalogsCommand"; +export * from "./pagination/ListDataCatalogsPaginator"; export * from "./commands/ListNamedQueriesCommand"; +export * from "./pagination/ListNamedQueriesPaginator"; export * from "./commands/ListQueryExecutionsCommand"; +export * from "./pagination/ListQueryExecutionsPaginator"; export * from "./commands/ListTableMetadataCommand"; +export * from "./pagination/ListTableMetadataPaginator"; export * from "./commands/ListTagsForResourceCommand"; +export * from "./pagination/ListTagsForResourcePaginator"; export * from "./commands/ListWorkGroupsCommand"; +export * from "./pagination/ListWorkGroupsPaginator"; export * from "./commands/StartQueryExecutionCommand"; export * from "./commands/StopQueryExecutionCommand"; export * from "./commands/TagResourceCommand"; export * from "./commands/UntagResourceCommand"; export * from "./commands/UpdateDataCatalogCommand"; export * from "./commands/UpdateWorkGroupCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-athena/pagination/GetQueryResultsPaginator.ts b/clients/client-athena/pagination/GetQueryResultsPaginator.ts new file mode 100644 index 0000000000000..718ccb5ae618f --- /dev/null +++ b/clients/client-athena/pagination/GetQueryResultsPaginator.ts @@ -0,0 +1,51 @@ +import { Athena } from "../Athena"; +import { AthenaClient } from "../AthenaClient"; +import { + GetQueryResultsCommand, + GetQueryResultsCommandInput, + GetQueryResultsCommandOutput, +} from "../commands/GetQueryResultsCommand"; +import { AthenaPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AthenaClient, + input: GetQueryResultsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetQueryResultsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Athena, + input: GetQueryResultsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getQueryResults(input, ...args); +}; +export async function* getQueryResultsPaginate( + config: AthenaPaginationConfiguration, + input: GetQueryResultsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetQueryResultsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Athena) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AthenaClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Athena | AthenaClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-athena/pagination/Interfaces.ts b/clients/client-athena/pagination/Interfaces.ts new file mode 100644 index 0000000000000..060b5cf598ac8 --- /dev/null +++ b/clients/client-athena/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { Athena } from "../Athena"; +import { AthenaClient } from "../AthenaClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface AthenaPaginationConfiguration extends PaginationConfiguration { + client: Athena | AthenaClient; +} diff --git a/clients/client-athena/pagination/ListDataCatalogsPaginator.ts b/clients/client-athena/pagination/ListDataCatalogsPaginator.ts new file mode 100644 index 0000000000000..977a936169246 --- /dev/null +++ b/clients/client-athena/pagination/ListDataCatalogsPaginator.ts @@ -0,0 +1,51 @@ +import { Athena } from "../Athena"; +import { AthenaClient } from "../AthenaClient"; +import { + ListDataCatalogsCommand, + ListDataCatalogsCommandInput, + ListDataCatalogsCommandOutput, +} from "../commands/ListDataCatalogsCommand"; +import { AthenaPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AthenaClient, + input: ListDataCatalogsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDataCatalogsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Athena, + input: ListDataCatalogsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDataCatalogs(input, ...args); +}; +export async function* listDataCatalogsPaginate( + config: AthenaPaginationConfiguration, + input: ListDataCatalogsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDataCatalogsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Athena) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AthenaClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Athena | AthenaClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-athena/pagination/ListDatabasesPaginator.ts b/clients/client-athena/pagination/ListDatabasesPaginator.ts new file mode 100644 index 0000000000000..22757f3f60617 --- /dev/null +++ b/clients/client-athena/pagination/ListDatabasesPaginator.ts @@ -0,0 +1,51 @@ +import { Athena } from "../Athena"; +import { AthenaClient } from "../AthenaClient"; +import { + ListDatabasesCommand, + ListDatabasesCommandInput, + ListDatabasesCommandOutput, +} from "../commands/ListDatabasesCommand"; +import { AthenaPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AthenaClient, + input: ListDatabasesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDatabasesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Athena, + input: ListDatabasesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDatabases(input, ...args); +}; +export async function* listDatabasesPaginate( + config: AthenaPaginationConfiguration, + input: ListDatabasesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDatabasesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Athena) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AthenaClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Athena | AthenaClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-athena/pagination/ListNamedQueriesPaginator.ts b/clients/client-athena/pagination/ListNamedQueriesPaginator.ts new file mode 100644 index 0000000000000..5f56739044aa2 --- /dev/null +++ b/clients/client-athena/pagination/ListNamedQueriesPaginator.ts @@ -0,0 +1,51 @@ +import { Athena } from "../Athena"; +import { AthenaClient } from "../AthenaClient"; +import { + ListNamedQueriesCommand, + ListNamedQueriesCommandInput, + ListNamedQueriesCommandOutput, +} from "../commands/ListNamedQueriesCommand"; +import { AthenaPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AthenaClient, + input: ListNamedQueriesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListNamedQueriesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Athena, + input: ListNamedQueriesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listNamedQueries(input, ...args); +}; +export async function* listNamedQueriesPaginate( + config: AthenaPaginationConfiguration, + input: ListNamedQueriesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListNamedQueriesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Athena) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AthenaClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Athena | AthenaClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-athena/pagination/ListQueryExecutionsPaginator.ts b/clients/client-athena/pagination/ListQueryExecutionsPaginator.ts new file mode 100644 index 0000000000000..00c7ac71e9395 --- /dev/null +++ b/clients/client-athena/pagination/ListQueryExecutionsPaginator.ts @@ -0,0 +1,51 @@ +import { Athena } from "../Athena"; +import { AthenaClient } from "../AthenaClient"; +import { + ListQueryExecutionsCommand, + ListQueryExecutionsCommandInput, + ListQueryExecutionsCommandOutput, +} from "../commands/ListQueryExecutionsCommand"; +import { AthenaPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AthenaClient, + input: ListQueryExecutionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListQueryExecutionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Athena, + input: ListQueryExecutionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listQueryExecutions(input, ...args); +}; +export async function* listQueryExecutionsPaginate( + config: AthenaPaginationConfiguration, + input: ListQueryExecutionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListQueryExecutionsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Athena) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AthenaClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Athena | AthenaClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-athena/pagination/ListTableMetadataPaginator.ts b/clients/client-athena/pagination/ListTableMetadataPaginator.ts new file mode 100644 index 0000000000000..783bed5b068bb --- /dev/null +++ b/clients/client-athena/pagination/ListTableMetadataPaginator.ts @@ -0,0 +1,51 @@ +import { Athena } from "../Athena"; +import { AthenaClient } from "../AthenaClient"; +import { + ListTableMetadataCommand, + ListTableMetadataCommandInput, + ListTableMetadataCommandOutput, +} from "../commands/ListTableMetadataCommand"; +import { AthenaPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AthenaClient, + input: ListTableMetadataCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTableMetadataCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Athena, + input: ListTableMetadataCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTableMetadata(input, ...args); +}; +export async function* listTableMetadataPaginate( + config: AthenaPaginationConfiguration, + input: ListTableMetadataCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTableMetadataCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Athena) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AthenaClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Athena | AthenaClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-athena/pagination/ListTagsForResourcePaginator.ts b/clients/client-athena/pagination/ListTagsForResourcePaginator.ts new file mode 100644 index 0000000000000..aba2bf97a22a4 --- /dev/null +++ b/clients/client-athena/pagination/ListTagsForResourcePaginator.ts @@ -0,0 +1,51 @@ +import { Athena } from "../Athena"; +import { AthenaClient } from "../AthenaClient"; +import { + ListTagsForResourceCommand, + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput, +} from "../commands/ListTagsForResourceCommand"; +import { AthenaPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AthenaClient, + input: ListTagsForResourceCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTagsForResourceCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Athena, + input: ListTagsForResourceCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTagsForResource(input, ...args); +}; +export async function* listTagsForResourcePaginate( + config: AthenaPaginationConfiguration, + input: ListTagsForResourceCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTagsForResourceCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Athena) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AthenaClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Athena | AthenaClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-athena/pagination/ListWorkGroupsPaginator.ts b/clients/client-athena/pagination/ListWorkGroupsPaginator.ts new file mode 100644 index 0000000000000..53fc254ea966c --- /dev/null +++ b/clients/client-athena/pagination/ListWorkGroupsPaginator.ts @@ -0,0 +1,51 @@ +import { Athena } from "../Athena"; +import { AthenaClient } from "../AthenaClient"; +import { + ListWorkGroupsCommand, + ListWorkGroupsCommandInput, + ListWorkGroupsCommandOutput, +} from "../commands/ListWorkGroupsCommand"; +import { AthenaPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AthenaClient, + input: ListWorkGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListWorkGroupsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Athena, + input: ListWorkGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listWorkGroups(input, ...args); +}; +export async function* listWorkGroupsPaginate( + config: AthenaPaginationConfiguration, + input: ListWorkGroupsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListWorkGroupsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Athena) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AthenaClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Athena | AthenaClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-auto-scaling/index.ts b/clients/client-auto-scaling/index.ts index f2b8db3eedda9..de30ab22c793e 100644 --- a/clients/client-auto-scaling/index.ts +++ b/clients/client-auto-scaling/index.ts @@ -20,21 +20,29 @@ export * from "./commands/DeleteTagsCommand"; export * from "./commands/DescribeAccountLimitsCommand"; export * from "./commands/DescribeAdjustmentTypesCommand"; export * from "./commands/DescribeAutoScalingGroupsCommand"; +export * from "./pagination/DescribeAutoScalingGroupsPaginator"; export * from "./commands/DescribeAutoScalingInstancesCommand"; +export * from "./pagination/DescribeAutoScalingInstancesPaginator"; export * from "./commands/DescribeAutoScalingNotificationTypesCommand"; export * from "./commands/DescribeInstanceRefreshesCommand"; export * from "./commands/DescribeLaunchConfigurationsCommand"; +export * from "./pagination/DescribeLaunchConfigurationsPaginator"; export * from "./commands/DescribeLifecycleHooksCommand"; export * from "./commands/DescribeLifecycleHookTypesCommand"; export * from "./commands/DescribeLoadBalancersCommand"; export * from "./commands/DescribeLoadBalancerTargetGroupsCommand"; export * from "./commands/DescribeMetricCollectionTypesCommand"; export * from "./commands/DescribeNotificationConfigurationsCommand"; +export * from "./pagination/DescribeNotificationConfigurationsPaginator"; export * from "./commands/DescribePoliciesCommand"; +export * from "./pagination/DescribePoliciesPaginator"; export * from "./commands/DescribeScalingActivitiesCommand"; +export * from "./pagination/DescribeScalingActivitiesPaginator"; export * from "./commands/DescribeScalingProcessTypesCommand"; export * from "./commands/DescribeScheduledActionsCommand"; +export * from "./pagination/DescribeScheduledActionsPaginator"; export * from "./commands/DescribeTagsCommand"; +export * from "./pagination/DescribeTagsPaginator"; export * from "./commands/DescribeTerminationPolicyTypesCommand"; export * from "./commands/DetachInstancesCommand"; export * from "./commands/DetachLoadBalancersCommand"; @@ -57,4 +65,5 @@ export * from "./commands/StartInstanceRefreshCommand"; export * from "./commands/SuspendProcessesCommand"; export * from "./commands/TerminateInstanceInAutoScalingGroupCommand"; export * from "./commands/UpdateAutoScalingGroupCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-auto-scaling/pagination/DescribeAutoScalingGroupsPaginator.ts b/clients/client-auto-scaling/pagination/DescribeAutoScalingGroupsPaginator.ts new file mode 100644 index 0000000000000..7e726e0f8ed0c --- /dev/null +++ b/clients/client-auto-scaling/pagination/DescribeAutoScalingGroupsPaginator.ts @@ -0,0 +1,51 @@ +import { AutoScaling } from "../AutoScaling"; +import { AutoScalingClient } from "../AutoScalingClient"; +import { + DescribeAutoScalingGroupsCommand, + DescribeAutoScalingGroupsCommandInput, + DescribeAutoScalingGroupsCommandOutput, +} from "../commands/DescribeAutoScalingGroupsCommand"; +import { AutoScalingPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AutoScalingClient, + input: DescribeAutoScalingGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeAutoScalingGroupsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: AutoScaling, + input: DescribeAutoScalingGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeAutoScalingGroups(input, ...args); +}; +export async function* describeAutoScalingGroupsPaginate( + config: AutoScalingPaginationConfiguration, + input: DescribeAutoScalingGroupsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeAutoScalingGroupsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof AutoScaling) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AutoScalingClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected AutoScaling | AutoScalingClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-auto-scaling/pagination/DescribeAutoScalingInstancesPaginator.ts b/clients/client-auto-scaling/pagination/DescribeAutoScalingInstancesPaginator.ts new file mode 100644 index 0000000000000..9f54ae221a146 --- /dev/null +++ b/clients/client-auto-scaling/pagination/DescribeAutoScalingInstancesPaginator.ts @@ -0,0 +1,51 @@ +import { AutoScaling } from "../AutoScaling"; +import { AutoScalingClient } from "../AutoScalingClient"; +import { + DescribeAutoScalingInstancesCommand, + DescribeAutoScalingInstancesCommandInput, + DescribeAutoScalingInstancesCommandOutput, +} from "../commands/DescribeAutoScalingInstancesCommand"; +import { AutoScalingPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AutoScalingClient, + input: DescribeAutoScalingInstancesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeAutoScalingInstancesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: AutoScaling, + input: DescribeAutoScalingInstancesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeAutoScalingInstances(input, ...args); +}; +export async function* describeAutoScalingInstancesPaginate( + config: AutoScalingPaginationConfiguration, + input: DescribeAutoScalingInstancesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeAutoScalingInstancesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof AutoScaling) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AutoScalingClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected AutoScaling | AutoScalingClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-auto-scaling/pagination/DescribeLaunchConfigurationsPaginator.ts b/clients/client-auto-scaling/pagination/DescribeLaunchConfigurationsPaginator.ts new file mode 100644 index 0000000000000..f64e41d93d6ff --- /dev/null +++ b/clients/client-auto-scaling/pagination/DescribeLaunchConfigurationsPaginator.ts @@ -0,0 +1,51 @@ +import { AutoScaling } from "../AutoScaling"; +import { AutoScalingClient } from "../AutoScalingClient"; +import { + DescribeLaunchConfigurationsCommand, + DescribeLaunchConfigurationsCommandInput, + DescribeLaunchConfigurationsCommandOutput, +} from "../commands/DescribeLaunchConfigurationsCommand"; +import { AutoScalingPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AutoScalingClient, + input: DescribeLaunchConfigurationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeLaunchConfigurationsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: AutoScaling, + input: DescribeLaunchConfigurationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeLaunchConfigurations(input, ...args); +}; +export async function* describeLaunchConfigurationsPaginate( + config: AutoScalingPaginationConfiguration, + input: DescribeLaunchConfigurationsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeLaunchConfigurationsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof AutoScaling) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AutoScalingClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected AutoScaling | AutoScalingClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-auto-scaling/pagination/DescribeNotificationConfigurationsPaginator.ts b/clients/client-auto-scaling/pagination/DescribeNotificationConfigurationsPaginator.ts new file mode 100644 index 0000000000000..019f1f10f3f46 --- /dev/null +++ b/clients/client-auto-scaling/pagination/DescribeNotificationConfigurationsPaginator.ts @@ -0,0 +1,51 @@ +import { AutoScaling } from "../AutoScaling"; +import { AutoScalingClient } from "../AutoScalingClient"; +import { + DescribeNotificationConfigurationsCommand, + DescribeNotificationConfigurationsCommandInput, + DescribeNotificationConfigurationsCommandOutput, +} from "../commands/DescribeNotificationConfigurationsCommand"; +import { AutoScalingPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AutoScalingClient, + input: DescribeNotificationConfigurationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeNotificationConfigurationsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: AutoScaling, + input: DescribeNotificationConfigurationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeNotificationConfigurations(input, ...args); +}; +export async function* describeNotificationConfigurationsPaginate( + config: AutoScalingPaginationConfiguration, + input: DescribeNotificationConfigurationsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeNotificationConfigurationsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof AutoScaling) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AutoScalingClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected AutoScaling | AutoScalingClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-auto-scaling/pagination/DescribePoliciesPaginator.ts b/clients/client-auto-scaling/pagination/DescribePoliciesPaginator.ts new file mode 100644 index 0000000000000..704c622fe8a04 --- /dev/null +++ b/clients/client-auto-scaling/pagination/DescribePoliciesPaginator.ts @@ -0,0 +1,51 @@ +import { AutoScaling } from "../AutoScaling"; +import { AutoScalingClient } from "../AutoScalingClient"; +import { + DescribePoliciesCommand, + DescribePoliciesCommandInput, + DescribePoliciesCommandOutput, +} from "../commands/DescribePoliciesCommand"; +import { AutoScalingPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AutoScalingClient, + input: DescribePoliciesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribePoliciesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: AutoScaling, + input: DescribePoliciesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describePolicies(input, ...args); +}; +export async function* describePoliciesPaginate( + config: AutoScalingPaginationConfiguration, + input: DescribePoliciesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribePoliciesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof AutoScaling) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AutoScalingClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected AutoScaling | AutoScalingClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-auto-scaling/pagination/DescribeScalingActivitiesPaginator.ts b/clients/client-auto-scaling/pagination/DescribeScalingActivitiesPaginator.ts new file mode 100644 index 0000000000000..de1a0d58c3bf0 --- /dev/null +++ b/clients/client-auto-scaling/pagination/DescribeScalingActivitiesPaginator.ts @@ -0,0 +1,51 @@ +import { AutoScaling } from "../AutoScaling"; +import { AutoScalingClient } from "../AutoScalingClient"; +import { + DescribeScalingActivitiesCommand, + DescribeScalingActivitiesCommandInput, + DescribeScalingActivitiesCommandOutput, +} from "../commands/DescribeScalingActivitiesCommand"; +import { AutoScalingPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AutoScalingClient, + input: DescribeScalingActivitiesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeScalingActivitiesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: AutoScaling, + input: DescribeScalingActivitiesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeScalingActivities(input, ...args); +}; +export async function* describeScalingActivitiesPaginate( + config: AutoScalingPaginationConfiguration, + input: DescribeScalingActivitiesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeScalingActivitiesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof AutoScaling) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AutoScalingClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected AutoScaling | AutoScalingClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-auto-scaling/pagination/DescribeScheduledActionsPaginator.ts b/clients/client-auto-scaling/pagination/DescribeScheduledActionsPaginator.ts new file mode 100644 index 0000000000000..942612f0127d6 --- /dev/null +++ b/clients/client-auto-scaling/pagination/DescribeScheduledActionsPaginator.ts @@ -0,0 +1,51 @@ +import { AutoScaling } from "../AutoScaling"; +import { AutoScalingClient } from "../AutoScalingClient"; +import { + DescribeScheduledActionsCommand, + DescribeScheduledActionsCommandInput, + DescribeScheduledActionsCommandOutput, +} from "../commands/DescribeScheduledActionsCommand"; +import { AutoScalingPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AutoScalingClient, + input: DescribeScheduledActionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeScheduledActionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: AutoScaling, + input: DescribeScheduledActionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeScheduledActions(input, ...args); +}; +export async function* describeScheduledActionsPaginate( + config: AutoScalingPaginationConfiguration, + input: DescribeScheduledActionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeScheduledActionsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof AutoScaling) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AutoScalingClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected AutoScaling | AutoScalingClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-auto-scaling/pagination/DescribeTagsPaginator.ts b/clients/client-auto-scaling/pagination/DescribeTagsPaginator.ts new file mode 100644 index 0000000000000..c62888680d919 --- /dev/null +++ b/clients/client-auto-scaling/pagination/DescribeTagsPaginator.ts @@ -0,0 +1,51 @@ +import { AutoScaling } from "../AutoScaling"; +import { AutoScalingClient } from "../AutoScalingClient"; +import { + DescribeTagsCommand, + DescribeTagsCommandInput, + DescribeTagsCommandOutput, +} from "../commands/DescribeTagsCommand"; +import { AutoScalingPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: AutoScalingClient, + input: DescribeTagsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeTagsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: AutoScaling, + input: DescribeTagsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeTags(input, ...args); +}; +export async function* describeTagsPaginate( + config: AutoScalingPaginationConfiguration, + input: DescribeTagsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeTagsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof AutoScaling) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof AutoScalingClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected AutoScaling | AutoScalingClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-auto-scaling/pagination/Interfaces.ts b/clients/client-auto-scaling/pagination/Interfaces.ts new file mode 100644 index 0000000000000..61d75e42cb620 --- /dev/null +++ b/clients/client-auto-scaling/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { AutoScaling } from "../AutoScaling"; +import { AutoScalingClient } from "../AutoScalingClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface AutoScalingPaginationConfiguration extends PaginationConfiguration { + client: AutoScaling | AutoScalingClient; +} diff --git a/clients/client-backup/index.ts b/clients/client-backup/index.ts index 969e00d8f6047..479d6211004d4 100644 --- a/clients/client-backup/index.ts +++ b/clients/client-backup/index.ts @@ -26,17 +26,29 @@ export * from "./commands/GetBackupVaultNotificationsCommand"; export * from "./commands/GetRecoveryPointRestoreMetadataCommand"; export * from "./commands/GetSupportedResourceTypesCommand"; export * from "./commands/ListBackupJobsCommand"; +export * from "./pagination/ListBackupJobsPaginator"; export * from "./commands/ListBackupPlansCommand"; +export * from "./pagination/ListBackupPlansPaginator"; export * from "./commands/ListBackupPlanTemplatesCommand"; +export * from "./pagination/ListBackupPlanTemplatesPaginator"; export * from "./commands/ListBackupPlanVersionsCommand"; +export * from "./pagination/ListBackupPlanVersionsPaginator"; export * from "./commands/ListBackupSelectionsCommand"; +export * from "./pagination/ListBackupSelectionsPaginator"; export * from "./commands/ListBackupVaultsCommand"; +export * from "./pagination/ListBackupVaultsPaginator"; export * from "./commands/ListCopyJobsCommand"; +export * from "./pagination/ListCopyJobsPaginator"; export * from "./commands/ListProtectedResourcesCommand"; +export * from "./pagination/ListProtectedResourcesPaginator"; export * from "./commands/ListRecoveryPointsByBackupVaultCommand"; +export * from "./pagination/ListRecoveryPointsByBackupVaultPaginator"; export * from "./commands/ListRecoveryPointsByResourceCommand"; +export * from "./pagination/ListRecoveryPointsByResourcePaginator"; export * from "./commands/ListRestoreJobsCommand"; +export * from "./pagination/ListRestoreJobsPaginator"; export * from "./commands/ListTagsCommand"; +export * from "./pagination/ListTagsPaginator"; export * from "./commands/PutBackupVaultAccessPolicyCommand"; export * from "./commands/PutBackupVaultNotificationsCommand"; export * from "./commands/StartBackupJobCommand"; @@ -48,4 +60,5 @@ export * from "./commands/UntagResourceCommand"; export * from "./commands/UpdateBackupPlanCommand"; export * from "./commands/UpdateRecoveryPointLifecycleCommand"; export * from "./commands/UpdateRegionSettingsCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-backup/pagination/Interfaces.ts b/clients/client-backup/pagination/Interfaces.ts new file mode 100644 index 0000000000000..27c1db6530674 --- /dev/null +++ b/clients/client-backup/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { Backup } from "../Backup"; +import { BackupClient } from "../BackupClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface BackupPaginationConfiguration extends PaginationConfiguration { + client: Backup | BackupClient; +} diff --git a/clients/client-backup/pagination/ListBackupJobsPaginator.ts b/clients/client-backup/pagination/ListBackupJobsPaginator.ts new file mode 100644 index 0000000000000..d9c51e1e0f5ca --- /dev/null +++ b/clients/client-backup/pagination/ListBackupJobsPaginator.ts @@ -0,0 +1,51 @@ +import { Backup } from "../Backup"; +import { BackupClient } from "../BackupClient"; +import { + ListBackupJobsCommand, + ListBackupJobsCommandInput, + ListBackupJobsCommandOutput, +} from "../commands/ListBackupJobsCommand"; +import { BackupPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: BackupClient, + input: ListBackupJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListBackupJobsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Backup, + input: ListBackupJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listBackupJobs(input, ...args); +}; +export async function* listBackupJobsPaginate( + config: BackupPaginationConfiguration, + input: ListBackupJobsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListBackupJobsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Backup) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof BackupClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Backup | BackupClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-backup/pagination/ListBackupPlanTemplatesPaginator.ts b/clients/client-backup/pagination/ListBackupPlanTemplatesPaginator.ts new file mode 100644 index 0000000000000..712bcf9cc9f5c --- /dev/null +++ b/clients/client-backup/pagination/ListBackupPlanTemplatesPaginator.ts @@ -0,0 +1,51 @@ +import { Backup } from "../Backup"; +import { BackupClient } from "../BackupClient"; +import { + ListBackupPlanTemplatesCommand, + ListBackupPlanTemplatesCommandInput, + ListBackupPlanTemplatesCommandOutput, +} from "../commands/ListBackupPlanTemplatesCommand"; +import { BackupPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: BackupClient, + input: ListBackupPlanTemplatesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListBackupPlanTemplatesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Backup, + input: ListBackupPlanTemplatesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listBackupPlanTemplates(input, ...args); +}; +export async function* listBackupPlanTemplatesPaginate( + config: BackupPaginationConfiguration, + input: ListBackupPlanTemplatesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListBackupPlanTemplatesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Backup) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof BackupClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Backup | BackupClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-backup/pagination/ListBackupPlanVersionsPaginator.ts b/clients/client-backup/pagination/ListBackupPlanVersionsPaginator.ts new file mode 100644 index 0000000000000..00d702f24003f --- /dev/null +++ b/clients/client-backup/pagination/ListBackupPlanVersionsPaginator.ts @@ -0,0 +1,51 @@ +import { Backup } from "../Backup"; +import { BackupClient } from "../BackupClient"; +import { + ListBackupPlanVersionsCommand, + ListBackupPlanVersionsCommandInput, + ListBackupPlanVersionsCommandOutput, +} from "../commands/ListBackupPlanVersionsCommand"; +import { BackupPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: BackupClient, + input: ListBackupPlanVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListBackupPlanVersionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Backup, + input: ListBackupPlanVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listBackupPlanVersions(input, ...args); +}; +export async function* listBackupPlanVersionsPaginate( + config: BackupPaginationConfiguration, + input: ListBackupPlanVersionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListBackupPlanVersionsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Backup) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof BackupClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Backup | BackupClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-backup/pagination/ListBackupPlansPaginator.ts b/clients/client-backup/pagination/ListBackupPlansPaginator.ts new file mode 100644 index 0000000000000..ddb41938e17f7 --- /dev/null +++ b/clients/client-backup/pagination/ListBackupPlansPaginator.ts @@ -0,0 +1,51 @@ +import { Backup } from "../Backup"; +import { BackupClient } from "../BackupClient"; +import { + ListBackupPlansCommand, + ListBackupPlansCommandInput, + ListBackupPlansCommandOutput, +} from "../commands/ListBackupPlansCommand"; +import { BackupPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: BackupClient, + input: ListBackupPlansCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListBackupPlansCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Backup, + input: ListBackupPlansCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listBackupPlans(input, ...args); +}; +export async function* listBackupPlansPaginate( + config: BackupPaginationConfiguration, + input: ListBackupPlansCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListBackupPlansCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Backup) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof BackupClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Backup | BackupClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-backup/pagination/ListBackupSelectionsPaginator.ts b/clients/client-backup/pagination/ListBackupSelectionsPaginator.ts new file mode 100644 index 0000000000000..64faa814ca17f --- /dev/null +++ b/clients/client-backup/pagination/ListBackupSelectionsPaginator.ts @@ -0,0 +1,51 @@ +import { Backup } from "../Backup"; +import { BackupClient } from "../BackupClient"; +import { + ListBackupSelectionsCommand, + ListBackupSelectionsCommandInput, + ListBackupSelectionsCommandOutput, +} from "../commands/ListBackupSelectionsCommand"; +import { BackupPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: BackupClient, + input: ListBackupSelectionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListBackupSelectionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Backup, + input: ListBackupSelectionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listBackupSelections(input, ...args); +}; +export async function* listBackupSelectionsPaginate( + config: BackupPaginationConfiguration, + input: ListBackupSelectionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListBackupSelectionsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Backup) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof BackupClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Backup | BackupClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-backup/pagination/ListBackupVaultsPaginator.ts b/clients/client-backup/pagination/ListBackupVaultsPaginator.ts new file mode 100644 index 0000000000000..5bd94b597a5d9 --- /dev/null +++ b/clients/client-backup/pagination/ListBackupVaultsPaginator.ts @@ -0,0 +1,51 @@ +import { Backup } from "../Backup"; +import { BackupClient } from "../BackupClient"; +import { + ListBackupVaultsCommand, + ListBackupVaultsCommandInput, + ListBackupVaultsCommandOutput, +} from "../commands/ListBackupVaultsCommand"; +import { BackupPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: BackupClient, + input: ListBackupVaultsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListBackupVaultsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Backup, + input: ListBackupVaultsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listBackupVaults(input, ...args); +}; +export async function* listBackupVaultsPaginate( + config: BackupPaginationConfiguration, + input: ListBackupVaultsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListBackupVaultsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Backup) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof BackupClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Backup | BackupClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-backup/pagination/ListCopyJobsPaginator.ts b/clients/client-backup/pagination/ListCopyJobsPaginator.ts new file mode 100644 index 0000000000000..ce9291c332fe9 --- /dev/null +++ b/clients/client-backup/pagination/ListCopyJobsPaginator.ts @@ -0,0 +1,51 @@ +import { Backup } from "../Backup"; +import { BackupClient } from "../BackupClient"; +import { + ListCopyJobsCommand, + ListCopyJobsCommandInput, + ListCopyJobsCommandOutput, +} from "../commands/ListCopyJobsCommand"; +import { BackupPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: BackupClient, + input: ListCopyJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListCopyJobsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Backup, + input: ListCopyJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listCopyJobs(input, ...args); +}; +export async function* listCopyJobsPaginate( + config: BackupPaginationConfiguration, + input: ListCopyJobsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListCopyJobsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Backup) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof BackupClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Backup | BackupClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-backup/pagination/ListProtectedResourcesPaginator.ts b/clients/client-backup/pagination/ListProtectedResourcesPaginator.ts new file mode 100644 index 0000000000000..3c6ef1bcd24b9 --- /dev/null +++ b/clients/client-backup/pagination/ListProtectedResourcesPaginator.ts @@ -0,0 +1,51 @@ +import { Backup } from "../Backup"; +import { BackupClient } from "../BackupClient"; +import { + ListProtectedResourcesCommand, + ListProtectedResourcesCommandInput, + ListProtectedResourcesCommandOutput, +} from "../commands/ListProtectedResourcesCommand"; +import { BackupPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: BackupClient, + input: ListProtectedResourcesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListProtectedResourcesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Backup, + input: ListProtectedResourcesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listProtectedResources(input, ...args); +}; +export async function* listProtectedResourcesPaginate( + config: BackupPaginationConfiguration, + input: ListProtectedResourcesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListProtectedResourcesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Backup) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof BackupClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Backup | BackupClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-backup/pagination/ListRecoveryPointsByBackupVaultPaginator.ts b/clients/client-backup/pagination/ListRecoveryPointsByBackupVaultPaginator.ts new file mode 100644 index 0000000000000..e7779251018c0 --- /dev/null +++ b/clients/client-backup/pagination/ListRecoveryPointsByBackupVaultPaginator.ts @@ -0,0 +1,51 @@ +import { Backup } from "../Backup"; +import { BackupClient } from "../BackupClient"; +import { + ListRecoveryPointsByBackupVaultCommand, + ListRecoveryPointsByBackupVaultCommandInput, + ListRecoveryPointsByBackupVaultCommandOutput, +} from "../commands/ListRecoveryPointsByBackupVaultCommand"; +import { BackupPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: BackupClient, + input: ListRecoveryPointsByBackupVaultCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListRecoveryPointsByBackupVaultCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Backup, + input: ListRecoveryPointsByBackupVaultCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listRecoveryPointsByBackupVault(input, ...args); +}; +export async function* listRecoveryPointsByBackupVaultPaginate( + config: BackupPaginationConfiguration, + input: ListRecoveryPointsByBackupVaultCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListRecoveryPointsByBackupVaultCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Backup) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof BackupClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Backup | BackupClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-backup/pagination/ListRecoveryPointsByResourcePaginator.ts b/clients/client-backup/pagination/ListRecoveryPointsByResourcePaginator.ts new file mode 100644 index 0000000000000..8d249cf74b839 --- /dev/null +++ b/clients/client-backup/pagination/ListRecoveryPointsByResourcePaginator.ts @@ -0,0 +1,51 @@ +import { Backup } from "../Backup"; +import { BackupClient } from "../BackupClient"; +import { + ListRecoveryPointsByResourceCommand, + ListRecoveryPointsByResourceCommandInput, + ListRecoveryPointsByResourceCommandOutput, +} from "../commands/ListRecoveryPointsByResourceCommand"; +import { BackupPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: BackupClient, + input: ListRecoveryPointsByResourceCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListRecoveryPointsByResourceCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Backup, + input: ListRecoveryPointsByResourceCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listRecoveryPointsByResource(input, ...args); +}; +export async function* listRecoveryPointsByResourcePaginate( + config: BackupPaginationConfiguration, + input: ListRecoveryPointsByResourceCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListRecoveryPointsByResourceCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Backup) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof BackupClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Backup | BackupClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-backup/pagination/ListRestoreJobsPaginator.ts b/clients/client-backup/pagination/ListRestoreJobsPaginator.ts new file mode 100644 index 0000000000000..c32266293cacc --- /dev/null +++ b/clients/client-backup/pagination/ListRestoreJobsPaginator.ts @@ -0,0 +1,51 @@ +import { Backup } from "../Backup"; +import { BackupClient } from "../BackupClient"; +import { + ListRestoreJobsCommand, + ListRestoreJobsCommandInput, + ListRestoreJobsCommandOutput, +} from "../commands/ListRestoreJobsCommand"; +import { BackupPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: BackupClient, + input: ListRestoreJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListRestoreJobsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Backup, + input: ListRestoreJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listRestoreJobs(input, ...args); +}; +export async function* listRestoreJobsPaginate( + config: BackupPaginationConfiguration, + input: ListRestoreJobsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListRestoreJobsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Backup) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof BackupClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Backup | BackupClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-backup/pagination/ListTagsPaginator.ts b/clients/client-backup/pagination/ListTagsPaginator.ts new file mode 100644 index 0000000000000..f86352106a54e --- /dev/null +++ b/clients/client-backup/pagination/ListTagsPaginator.ts @@ -0,0 +1,47 @@ +import { Backup } from "../Backup"; +import { BackupClient } from "../BackupClient"; +import { ListTagsCommand, ListTagsCommandInput, ListTagsCommandOutput } from "../commands/ListTagsCommand"; +import { BackupPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: BackupClient, + input: ListTagsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTagsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Backup, + input: ListTagsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTags(input, ...args); +}; +export async function* listTagsPaginate( + config: BackupPaginationConfiguration, + input: ListTagsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTagsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Backup) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof BackupClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Backup | BackupClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-batch/index.ts b/clients/client-batch/index.ts index 0be61dd90e1fa..2cdef51e91537 100644 --- a/clients/client-batch/index.ts +++ b/clients/client-batch/index.ts @@ -7,13 +7,18 @@ export * from "./commands/DeleteComputeEnvironmentCommand"; export * from "./commands/DeleteJobQueueCommand"; export * from "./commands/DeregisterJobDefinitionCommand"; export * from "./commands/DescribeComputeEnvironmentsCommand"; +export * from "./pagination/DescribeComputeEnvironmentsPaginator"; export * from "./commands/DescribeJobDefinitionsCommand"; +export * from "./pagination/DescribeJobDefinitionsPaginator"; export * from "./commands/DescribeJobQueuesCommand"; +export * from "./pagination/DescribeJobQueuesPaginator"; export * from "./commands/DescribeJobsCommand"; export * from "./commands/ListJobsCommand"; +export * from "./pagination/ListJobsPaginator"; export * from "./commands/RegisterJobDefinitionCommand"; export * from "./commands/SubmitJobCommand"; export * from "./commands/TerminateJobCommand"; export * from "./commands/UpdateComputeEnvironmentCommand"; export * from "./commands/UpdateJobQueueCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-batch/pagination/DescribeComputeEnvironmentsPaginator.ts b/clients/client-batch/pagination/DescribeComputeEnvironmentsPaginator.ts new file mode 100644 index 0000000000000..54c349c4d2c76 --- /dev/null +++ b/clients/client-batch/pagination/DescribeComputeEnvironmentsPaginator.ts @@ -0,0 +1,51 @@ +import { Batch } from "../Batch"; +import { BatchClient } from "../BatchClient"; +import { + DescribeComputeEnvironmentsCommand, + DescribeComputeEnvironmentsCommandInput, + DescribeComputeEnvironmentsCommandOutput, +} from "../commands/DescribeComputeEnvironmentsCommand"; +import { BatchPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: BatchClient, + input: DescribeComputeEnvironmentsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeComputeEnvironmentsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Batch, + input: DescribeComputeEnvironmentsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeComputeEnvironments(input, ...args); +}; +export async function* describeComputeEnvironmentsPaginate( + config: BatchPaginationConfiguration, + input: DescribeComputeEnvironmentsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeComputeEnvironmentsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof Batch) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof BatchClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Batch | BatchClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-batch/pagination/DescribeJobDefinitionsPaginator.ts b/clients/client-batch/pagination/DescribeJobDefinitionsPaginator.ts new file mode 100644 index 0000000000000..5fac4173a9b46 --- /dev/null +++ b/clients/client-batch/pagination/DescribeJobDefinitionsPaginator.ts @@ -0,0 +1,51 @@ +import { Batch } from "../Batch"; +import { BatchClient } from "../BatchClient"; +import { + DescribeJobDefinitionsCommand, + DescribeJobDefinitionsCommandInput, + DescribeJobDefinitionsCommandOutput, +} from "../commands/DescribeJobDefinitionsCommand"; +import { BatchPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: BatchClient, + input: DescribeJobDefinitionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeJobDefinitionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Batch, + input: DescribeJobDefinitionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeJobDefinitions(input, ...args); +}; +export async function* describeJobDefinitionsPaginate( + config: BatchPaginationConfiguration, + input: DescribeJobDefinitionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeJobDefinitionsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof Batch) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof BatchClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Batch | BatchClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-batch/pagination/DescribeJobQueuesPaginator.ts b/clients/client-batch/pagination/DescribeJobQueuesPaginator.ts new file mode 100644 index 0000000000000..cc6a8517880ee --- /dev/null +++ b/clients/client-batch/pagination/DescribeJobQueuesPaginator.ts @@ -0,0 +1,51 @@ +import { Batch } from "../Batch"; +import { BatchClient } from "../BatchClient"; +import { + DescribeJobQueuesCommand, + DescribeJobQueuesCommandInput, + DescribeJobQueuesCommandOutput, +} from "../commands/DescribeJobQueuesCommand"; +import { BatchPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: BatchClient, + input: DescribeJobQueuesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeJobQueuesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Batch, + input: DescribeJobQueuesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeJobQueues(input, ...args); +}; +export async function* describeJobQueuesPaginate( + config: BatchPaginationConfiguration, + input: DescribeJobQueuesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeJobQueuesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof Batch) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof BatchClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Batch | BatchClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-batch/pagination/Interfaces.ts b/clients/client-batch/pagination/Interfaces.ts new file mode 100644 index 0000000000000..82a74a8e3409c --- /dev/null +++ b/clients/client-batch/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { Batch } from "../Batch"; +import { BatchClient } from "../BatchClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface BatchPaginationConfiguration extends PaginationConfiguration { + client: Batch | BatchClient; +} diff --git a/clients/client-batch/pagination/ListJobsPaginator.ts b/clients/client-batch/pagination/ListJobsPaginator.ts new file mode 100644 index 0000000000000..79fd189606afb --- /dev/null +++ b/clients/client-batch/pagination/ListJobsPaginator.ts @@ -0,0 +1,47 @@ +import { Batch } from "../Batch"; +import { BatchClient } from "../BatchClient"; +import { ListJobsCommand, ListJobsCommandInput, ListJobsCommandOutput } from "../commands/ListJobsCommand"; +import { BatchPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: BatchClient, + input: ListJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListJobsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Batch, + input: ListJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listJobs(input, ...args); +}; +export async function* listJobsPaginate( + config: BatchPaginationConfiguration, + input: ListJobsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListJobsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof Batch) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof BatchClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Batch | BatchClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-chime/index.ts b/clients/client-chime/index.ts index 2dbafffa0d27e..6238000168c1b 100644 --- a/clients/client-chime/index.ts +++ b/clients/client-chime/index.ts @@ -69,20 +69,32 @@ export * from "./commands/GetVoiceConnectorTerminationCommand"; export * from "./commands/GetVoiceConnectorTerminationHealthCommand"; export * from "./commands/InviteUsersCommand"; export * from "./commands/ListAccountsCommand"; +export * from "./pagination/ListAccountsPaginator"; export * from "./commands/ListAttendeesCommand"; +export * from "./pagination/ListAttendeesPaginator"; export * from "./commands/ListAttendeeTagsCommand"; export * from "./commands/ListBotsCommand"; +export * from "./pagination/ListBotsPaginator"; export * from "./commands/ListMeetingsCommand"; +export * from "./pagination/ListMeetingsPaginator"; export * from "./commands/ListMeetingTagsCommand"; export * from "./commands/ListPhoneNumberOrdersCommand"; +export * from "./pagination/ListPhoneNumberOrdersPaginator"; export * from "./commands/ListPhoneNumbersCommand"; +export * from "./pagination/ListPhoneNumbersPaginator"; export * from "./commands/ListProxySessionsCommand"; +export * from "./pagination/ListProxySessionsPaginator"; export * from "./commands/ListRoomMembershipsCommand"; +export * from "./pagination/ListRoomMembershipsPaginator"; export * from "./commands/ListRoomsCommand"; +export * from "./pagination/ListRoomsPaginator"; export * from "./commands/ListTagsForResourceCommand"; export * from "./commands/ListUsersCommand"; +export * from "./pagination/ListUsersPaginator"; export * from "./commands/ListVoiceConnectorGroupsCommand"; +export * from "./pagination/ListVoiceConnectorGroupsPaginator"; export * from "./commands/ListVoiceConnectorsCommand"; +export * from "./pagination/ListVoiceConnectorsPaginator"; export * from "./commands/ListVoiceConnectorTerminationCredentialsCommand"; export * from "./commands/LogoutUserCommand"; export * from "./commands/PutEventsConfigurationCommand"; @@ -119,4 +131,5 @@ export * from "./commands/UpdateUserCommand"; export * from "./commands/UpdateUserSettingsCommand"; export * from "./commands/UpdateVoiceConnectorCommand"; export * from "./commands/UpdateVoiceConnectorGroupCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-chime/pagination/Interfaces.ts b/clients/client-chime/pagination/Interfaces.ts new file mode 100644 index 0000000000000..dac6f8a9e117e --- /dev/null +++ b/clients/client-chime/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { Chime } from "../Chime"; +import { ChimeClient } from "../ChimeClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface ChimePaginationConfiguration extends PaginationConfiguration { + client: Chime | ChimeClient; +} diff --git a/clients/client-chime/pagination/ListAccountsPaginator.ts b/clients/client-chime/pagination/ListAccountsPaginator.ts new file mode 100644 index 0000000000000..6b212743764a1 --- /dev/null +++ b/clients/client-chime/pagination/ListAccountsPaginator.ts @@ -0,0 +1,51 @@ +import { Chime } from "../Chime"; +import { ChimeClient } from "../ChimeClient"; +import { + ListAccountsCommand, + ListAccountsCommandInput, + ListAccountsCommandOutput, +} from "../commands/ListAccountsCommand"; +import { ChimePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ChimeClient, + input: ListAccountsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListAccountsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Chime, + input: ListAccountsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listAccounts(input, ...args); +}; +export async function* listAccountsPaginate( + config: ChimePaginationConfiguration, + input: ListAccountsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListAccountsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Chime) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ChimeClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Chime | ChimeClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-chime/pagination/ListAttendeesPaginator.ts b/clients/client-chime/pagination/ListAttendeesPaginator.ts new file mode 100644 index 0000000000000..f19ea0322c179 --- /dev/null +++ b/clients/client-chime/pagination/ListAttendeesPaginator.ts @@ -0,0 +1,51 @@ +import { Chime } from "../Chime"; +import { ChimeClient } from "../ChimeClient"; +import { + ListAttendeesCommand, + ListAttendeesCommandInput, + ListAttendeesCommandOutput, +} from "../commands/ListAttendeesCommand"; +import { ChimePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ChimeClient, + input: ListAttendeesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListAttendeesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Chime, + input: ListAttendeesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listAttendees(input, ...args); +}; +export async function* listAttendeesPaginate( + config: ChimePaginationConfiguration, + input: ListAttendeesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListAttendeesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Chime) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ChimeClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Chime | ChimeClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-chime/pagination/ListBotsPaginator.ts b/clients/client-chime/pagination/ListBotsPaginator.ts new file mode 100644 index 0000000000000..2db0ddfb06f6b --- /dev/null +++ b/clients/client-chime/pagination/ListBotsPaginator.ts @@ -0,0 +1,47 @@ +import { Chime } from "../Chime"; +import { ChimeClient } from "../ChimeClient"; +import { ListBotsCommand, ListBotsCommandInput, ListBotsCommandOutput } from "../commands/ListBotsCommand"; +import { ChimePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ChimeClient, + input: ListBotsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListBotsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Chime, + input: ListBotsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listBots(input, ...args); +}; +export async function* listBotsPaginate( + config: ChimePaginationConfiguration, + input: ListBotsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListBotsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Chime) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ChimeClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Chime | ChimeClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-chime/pagination/ListMeetingsPaginator.ts b/clients/client-chime/pagination/ListMeetingsPaginator.ts new file mode 100644 index 0000000000000..93a002c7ae5d7 --- /dev/null +++ b/clients/client-chime/pagination/ListMeetingsPaginator.ts @@ -0,0 +1,51 @@ +import { Chime } from "../Chime"; +import { ChimeClient } from "../ChimeClient"; +import { + ListMeetingsCommand, + ListMeetingsCommandInput, + ListMeetingsCommandOutput, +} from "../commands/ListMeetingsCommand"; +import { ChimePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ChimeClient, + input: ListMeetingsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListMeetingsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Chime, + input: ListMeetingsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listMeetings(input, ...args); +}; +export async function* listMeetingsPaginate( + config: ChimePaginationConfiguration, + input: ListMeetingsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListMeetingsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Chime) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ChimeClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Chime | ChimeClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-chime/pagination/ListPhoneNumberOrdersPaginator.ts b/clients/client-chime/pagination/ListPhoneNumberOrdersPaginator.ts new file mode 100644 index 0000000000000..5c41b8e46dc92 --- /dev/null +++ b/clients/client-chime/pagination/ListPhoneNumberOrdersPaginator.ts @@ -0,0 +1,51 @@ +import { Chime } from "../Chime"; +import { ChimeClient } from "../ChimeClient"; +import { + ListPhoneNumberOrdersCommand, + ListPhoneNumberOrdersCommandInput, + ListPhoneNumberOrdersCommandOutput, +} from "../commands/ListPhoneNumberOrdersCommand"; +import { ChimePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ChimeClient, + input: ListPhoneNumberOrdersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListPhoneNumberOrdersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Chime, + input: ListPhoneNumberOrdersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listPhoneNumberOrders(input, ...args); +}; +export async function* listPhoneNumberOrdersPaginate( + config: ChimePaginationConfiguration, + input: ListPhoneNumberOrdersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListPhoneNumberOrdersCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Chime) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ChimeClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Chime | ChimeClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-chime/pagination/ListPhoneNumbersPaginator.ts b/clients/client-chime/pagination/ListPhoneNumbersPaginator.ts new file mode 100644 index 0000000000000..e00e3b2619d22 --- /dev/null +++ b/clients/client-chime/pagination/ListPhoneNumbersPaginator.ts @@ -0,0 +1,51 @@ +import { Chime } from "../Chime"; +import { ChimeClient } from "../ChimeClient"; +import { + ListPhoneNumbersCommand, + ListPhoneNumbersCommandInput, + ListPhoneNumbersCommandOutput, +} from "../commands/ListPhoneNumbersCommand"; +import { ChimePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ChimeClient, + input: ListPhoneNumbersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListPhoneNumbersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Chime, + input: ListPhoneNumbersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listPhoneNumbers(input, ...args); +}; +export async function* listPhoneNumbersPaginate( + config: ChimePaginationConfiguration, + input: ListPhoneNumbersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListPhoneNumbersCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Chime) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ChimeClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Chime | ChimeClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-chime/pagination/ListProxySessionsPaginator.ts b/clients/client-chime/pagination/ListProxySessionsPaginator.ts new file mode 100644 index 0000000000000..f086b9de4f35e --- /dev/null +++ b/clients/client-chime/pagination/ListProxySessionsPaginator.ts @@ -0,0 +1,51 @@ +import { Chime } from "../Chime"; +import { ChimeClient } from "../ChimeClient"; +import { + ListProxySessionsCommand, + ListProxySessionsCommandInput, + ListProxySessionsCommandOutput, +} from "../commands/ListProxySessionsCommand"; +import { ChimePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ChimeClient, + input: ListProxySessionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListProxySessionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Chime, + input: ListProxySessionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listProxySessions(input, ...args); +}; +export async function* listProxySessionsPaginate( + config: ChimePaginationConfiguration, + input: ListProxySessionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListProxySessionsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Chime) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ChimeClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Chime | ChimeClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-chime/pagination/ListRoomMembershipsPaginator.ts b/clients/client-chime/pagination/ListRoomMembershipsPaginator.ts new file mode 100644 index 0000000000000..d074c3bf72416 --- /dev/null +++ b/clients/client-chime/pagination/ListRoomMembershipsPaginator.ts @@ -0,0 +1,51 @@ +import { Chime } from "../Chime"; +import { ChimeClient } from "../ChimeClient"; +import { + ListRoomMembershipsCommand, + ListRoomMembershipsCommandInput, + ListRoomMembershipsCommandOutput, +} from "../commands/ListRoomMembershipsCommand"; +import { ChimePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ChimeClient, + input: ListRoomMembershipsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListRoomMembershipsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Chime, + input: ListRoomMembershipsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listRoomMemberships(input, ...args); +}; +export async function* listRoomMembershipsPaginate( + config: ChimePaginationConfiguration, + input: ListRoomMembershipsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListRoomMembershipsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Chime) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ChimeClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Chime | ChimeClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-chime/pagination/ListRoomsPaginator.ts b/clients/client-chime/pagination/ListRoomsPaginator.ts new file mode 100644 index 0000000000000..41ab32d5745c5 --- /dev/null +++ b/clients/client-chime/pagination/ListRoomsPaginator.ts @@ -0,0 +1,47 @@ +import { Chime } from "../Chime"; +import { ChimeClient } from "../ChimeClient"; +import { ListRoomsCommand, ListRoomsCommandInput, ListRoomsCommandOutput } from "../commands/ListRoomsCommand"; +import { ChimePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ChimeClient, + input: ListRoomsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListRoomsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Chime, + input: ListRoomsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listRooms(input, ...args); +}; +export async function* listRoomsPaginate( + config: ChimePaginationConfiguration, + input: ListRoomsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListRoomsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Chime) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ChimeClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Chime | ChimeClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-chime/pagination/ListUsersPaginator.ts b/clients/client-chime/pagination/ListUsersPaginator.ts new file mode 100644 index 0000000000000..d741f804d3f9b --- /dev/null +++ b/clients/client-chime/pagination/ListUsersPaginator.ts @@ -0,0 +1,47 @@ +import { Chime } from "../Chime"; +import { ChimeClient } from "../ChimeClient"; +import { ListUsersCommand, ListUsersCommandInput, ListUsersCommandOutput } from "../commands/ListUsersCommand"; +import { ChimePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ChimeClient, + input: ListUsersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListUsersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Chime, + input: ListUsersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listUsers(input, ...args); +}; +export async function* listUsersPaginate( + config: ChimePaginationConfiguration, + input: ListUsersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListUsersCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Chime) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ChimeClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Chime | ChimeClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-chime/pagination/ListVoiceConnectorGroupsPaginator.ts b/clients/client-chime/pagination/ListVoiceConnectorGroupsPaginator.ts new file mode 100644 index 0000000000000..01cfe8e6655e7 --- /dev/null +++ b/clients/client-chime/pagination/ListVoiceConnectorGroupsPaginator.ts @@ -0,0 +1,51 @@ +import { Chime } from "../Chime"; +import { ChimeClient } from "../ChimeClient"; +import { + ListVoiceConnectorGroupsCommand, + ListVoiceConnectorGroupsCommandInput, + ListVoiceConnectorGroupsCommandOutput, +} from "../commands/ListVoiceConnectorGroupsCommand"; +import { ChimePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ChimeClient, + input: ListVoiceConnectorGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListVoiceConnectorGroupsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Chime, + input: ListVoiceConnectorGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listVoiceConnectorGroups(input, ...args); +}; +export async function* listVoiceConnectorGroupsPaginate( + config: ChimePaginationConfiguration, + input: ListVoiceConnectorGroupsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListVoiceConnectorGroupsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Chime) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ChimeClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Chime | ChimeClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-chime/pagination/ListVoiceConnectorsPaginator.ts b/clients/client-chime/pagination/ListVoiceConnectorsPaginator.ts new file mode 100644 index 0000000000000..5c01478d55965 --- /dev/null +++ b/clients/client-chime/pagination/ListVoiceConnectorsPaginator.ts @@ -0,0 +1,51 @@ +import { Chime } from "../Chime"; +import { ChimeClient } from "../ChimeClient"; +import { + ListVoiceConnectorsCommand, + ListVoiceConnectorsCommandInput, + ListVoiceConnectorsCommandOutput, +} from "../commands/ListVoiceConnectorsCommand"; +import { ChimePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ChimeClient, + input: ListVoiceConnectorsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListVoiceConnectorsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Chime, + input: ListVoiceConnectorsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listVoiceConnectors(input, ...args); +}; +export async function* listVoiceConnectorsPaginate( + config: ChimePaginationConfiguration, + input: ListVoiceConnectorsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListVoiceConnectorsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Chime) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ChimeClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Chime | ChimeClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-cloud9/index.ts b/clients/client-cloud9/index.ts index 1a759bb7be93e..5f34a968cc72b 100644 --- a/clients/client-cloud9/index.ts +++ b/clients/client-cloud9/index.ts @@ -5,12 +5,15 @@ export * from "./commands/CreateEnvironmentMembershipCommand"; export * from "./commands/DeleteEnvironmentCommand"; export * from "./commands/DeleteEnvironmentMembershipCommand"; export * from "./commands/DescribeEnvironmentMembershipsCommand"; +export * from "./pagination/DescribeEnvironmentMembershipsPaginator"; export * from "./commands/DescribeEnvironmentsCommand"; export * from "./commands/DescribeEnvironmentStatusCommand"; export * from "./commands/ListEnvironmentsCommand"; +export * from "./pagination/ListEnvironmentsPaginator"; export * from "./commands/ListTagsForResourceCommand"; export * from "./commands/TagResourceCommand"; export * from "./commands/UntagResourceCommand"; export * from "./commands/UpdateEnvironmentCommand"; export * from "./commands/UpdateEnvironmentMembershipCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-cloud9/pagination/DescribeEnvironmentMembershipsPaginator.ts b/clients/client-cloud9/pagination/DescribeEnvironmentMembershipsPaginator.ts new file mode 100644 index 0000000000000..42cc2122e8d7a --- /dev/null +++ b/clients/client-cloud9/pagination/DescribeEnvironmentMembershipsPaginator.ts @@ -0,0 +1,51 @@ +import { Cloud9 } from "../Cloud9"; +import { Cloud9Client } from "../Cloud9Client"; +import { + DescribeEnvironmentMembershipsCommand, + DescribeEnvironmentMembershipsCommandInput, + DescribeEnvironmentMembershipsCommandOutput, +} from "../commands/DescribeEnvironmentMembershipsCommand"; +import { Cloud9PaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: Cloud9Client, + input: DescribeEnvironmentMembershipsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeEnvironmentMembershipsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Cloud9, + input: DescribeEnvironmentMembershipsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeEnvironmentMemberships(input, ...args); +}; +export async function* describeEnvironmentMembershipsPaginate( + config: Cloud9PaginationConfiguration, + input: DescribeEnvironmentMembershipsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeEnvironmentMembershipsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof Cloud9) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof Cloud9Client) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Cloud9 | Cloud9Client"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-cloud9/pagination/Interfaces.ts b/clients/client-cloud9/pagination/Interfaces.ts new file mode 100644 index 0000000000000..9c928c705c7e8 --- /dev/null +++ b/clients/client-cloud9/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { Cloud9 } from "../Cloud9"; +import { Cloud9Client } from "../Cloud9Client"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface Cloud9PaginationConfiguration extends PaginationConfiguration { + client: Cloud9 | Cloud9Client; +} diff --git a/clients/client-cloud9/pagination/ListEnvironmentsPaginator.ts b/clients/client-cloud9/pagination/ListEnvironmentsPaginator.ts new file mode 100644 index 0000000000000..95ad676daed66 --- /dev/null +++ b/clients/client-cloud9/pagination/ListEnvironmentsPaginator.ts @@ -0,0 +1,51 @@ +import { Cloud9 } from "../Cloud9"; +import { Cloud9Client } from "../Cloud9Client"; +import { + ListEnvironmentsCommand, + ListEnvironmentsCommandInput, + ListEnvironmentsCommandOutput, +} from "../commands/ListEnvironmentsCommand"; +import { Cloud9PaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: Cloud9Client, + input: ListEnvironmentsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListEnvironmentsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Cloud9, + input: ListEnvironmentsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listEnvironments(input, ...args); +}; +export async function* listEnvironmentsPaginate( + config: Cloud9PaginationConfiguration, + input: ListEnvironmentsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListEnvironmentsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof Cloud9) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof Cloud9Client) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Cloud9 | Cloud9Client"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-clouddirectory/index.ts b/clients/client-clouddirectory/index.ts index 6a59b713cbc96..972c50e12f481 100644 --- a/clients/client-clouddirectory/index.ts +++ b/clients/client-clouddirectory/index.ts @@ -34,26 +34,45 @@ export * from "./commands/GetObjectInformationCommand"; export * from "./commands/GetSchemaAsJsonCommand"; export * from "./commands/GetTypedLinkFacetInformationCommand"; export * from "./commands/ListAppliedSchemaArnsCommand"; +export * from "./pagination/ListAppliedSchemaArnsPaginator"; export * from "./commands/ListAttachedIndicesCommand"; +export * from "./pagination/ListAttachedIndicesPaginator"; export * from "./commands/ListDevelopmentSchemaArnsCommand"; +export * from "./pagination/ListDevelopmentSchemaArnsPaginator"; export * from "./commands/ListDirectoriesCommand"; +export * from "./pagination/ListDirectoriesPaginator"; export * from "./commands/ListFacetAttributesCommand"; +export * from "./pagination/ListFacetAttributesPaginator"; export * from "./commands/ListFacetNamesCommand"; +export * from "./pagination/ListFacetNamesPaginator"; export * from "./commands/ListIncomingTypedLinksCommand"; export * from "./commands/ListIndexCommand"; +export * from "./pagination/ListIndexPaginator"; export * from "./commands/ListManagedSchemaArnsCommand"; +export * from "./pagination/ListManagedSchemaArnsPaginator"; export * from "./commands/ListObjectAttributesCommand"; +export * from "./pagination/ListObjectAttributesPaginator"; export * from "./commands/ListObjectChildrenCommand"; +export * from "./pagination/ListObjectChildrenPaginator"; export * from "./commands/ListObjectParentPathsCommand"; +export * from "./pagination/ListObjectParentPathsPaginator"; export * from "./commands/ListObjectParentsCommand"; +export * from "./pagination/ListObjectParentsPaginator"; export * from "./commands/ListObjectPoliciesCommand"; +export * from "./pagination/ListObjectPoliciesPaginator"; export * from "./commands/ListOutgoingTypedLinksCommand"; export * from "./commands/ListPolicyAttachmentsCommand"; +export * from "./pagination/ListPolicyAttachmentsPaginator"; export * from "./commands/ListPublishedSchemaArnsCommand"; +export * from "./pagination/ListPublishedSchemaArnsPaginator"; export * from "./commands/ListTagsForResourceCommand"; +export * from "./pagination/ListTagsForResourcePaginator"; export * from "./commands/ListTypedLinkFacetAttributesCommand"; +export * from "./pagination/ListTypedLinkFacetAttributesPaginator"; export * from "./commands/ListTypedLinkFacetNamesCommand"; +export * from "./pagination/ListTypedLinkFacetNamesPaginator"; export * from "./commands/LookupPolicyCommand"; +export * from "./pagination/LookupPolicyPaginator"; export * from "./commands/PublishSchemaCommand"; export * from "./commands/PutSchemaFromJsonCommand"; export * from "./commands/RemoveFacetFromObjectCommand"; @@ -66,4 +85,5 @@ export * from "./commands/UpdateSchemaCommand"; export * from "./commands/UpdateTypedLinkFacetCommand"; export * from "./commands/UpgradeAppliedSchemaCommand"; export * from "./commands/UpgradePublishedSchemaCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-clouddirectory/pagination/Interfaces.ts b/clients/client-clouddirectory/pagination/Interfaces.ts new file mode 100644 index 0000000000000..5506544493b6a --- /dev/null +++ b/clients/client-clouddirectory/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { CloudDirectory } from "../CloudDirectory"; +import { CloudDirectoryClient } from "../CloudDirectoryClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface CloudDirectoryPaginationConfiguration extends PaginationConfiguration { + client: CloudDirectory | CloudDirectoryClient; +} diff --git a/clients/client-clouddirectory/pagination/ListAppliedSchemaArnsPaginator.ts b/clients/client-clouddirectory/pagination/ListAppliedSchemaArnsPaginator.ts new file mode 100644 index 0000000000000..d4181ccab80dd --- /dev/null +++ b/clients/client-clouddirectory/pagination/ListAppliedSchemaArnsPaginator.ts @@ -0,0 +1,51 @@ +import { CloudDirectory } from "../CloudDirectory"; +import { CloudDirectoryClient } from "../CloudDirectoryClient"; +import { + ListAppliedSchemaArnsCommand, + ListAppliedSchemaArnsCommandInput, + ListAppliedSchemaArnsCommandOutput, +} from "../commands/ListAppliedSchemaArnsCommand"; +import { CloudDirectoryPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudDirectoryClient, + input: ListAppliedSchemaArnsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListAppliedSchemaArnsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudDirectory, + input: ListAppliedSchemaArnsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listAppliedSchemaArns(input, ...args); +}; +export async function* listAppliedSchemaArnsPaginate( + config: CloudDirectoryPaginationConfiguration, + input: ListAppliedSchemaArnsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListAppliedSchemaArnsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof CloudDirectory) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudDirectoryClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudDirectory | CloudDirectoryClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-clouddirectory/pagination/ListAttachedIndicesPaginator.ts b/clients/client-clouddirectory/pagination/ListAttachedIndicesPaginator.ts new file mode 100644 index 0000000000000..02be29628b46a --- /dev/null +++ b/clients/client-clouddirectory/pagination/ListAttachedIndicesPaginator.ts @@ -0,0 +1,51 @@ +import { CloudDirectory } from "../CloudDirectory"; +import { CloudDirectoryClient } from "../CloudDirectoryClient"; +import { + ListAttachedIndicesCommand, + ListAttachedIndicesCommandInput, + ListAttachedIndicesCommandOutput, +} from "../commands/ListAttachedIndicesCommand"; +import { CloudDirectoryPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudDirectoryClient, + input: ListAttachedIndicesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListAttachedIndicesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudDirectory, + input: ListAttachedIndicesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listAttachedIndices(input, ...args); +}; +export async function* listAttachedIndicesPaginate( + config: CloudDirectoryPaginationConfiguration, + input: ListAttachedIndicesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListAttachedIndicesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof CloudDirectory) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudDirectoryClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudDirectory | CloudDirectoryClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-clouddirectory/pagination/ListDevelopmentSchemaArnsPaginator.ts b/clients/client-clouddirectory/pagination/ListDevelopmentSchemaArnsPaginator.ts new file mode 100644 index 0000000000000..893e100cd4e58 --- /dev/null +++ b/clients/client-clouddirectory/pagination/ListDevelopmentSchemaArnsPaginator.ts @@ -0,0 +1,51 @@ +import { CloudDirectory } from "../CloudDirectory"; +import { CloudDirectoryClient } from "../CloudDirectoryClient"; +import { + ListDevelopmentSchemaArnsCommand, + ListDevelopmentSchemaArnsCommandInput, + ListDevelopmentSchemaArnsCommandOutput, +} from "../commands/ListDevelopmentSchemaArnsCommand"; +import { CloudDirectoryPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudDirectoryClient, + input: ListDevelopmentSchemaArnsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDevelopmentSchemaArnsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudDirectory, + input: ListDevelopmentSchemaArnsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDevelopmentSchemaArns(input, ...args); +}; +export async function* listDevelopmentSchemaArnsPaginate( + config: CloudDirectoryPaginationConfiguration, + input: ListDevelopmentSchemaArnsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDevelopmentSchemaArnsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof CloudDirectory) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudDirectoryClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudDirectory | CloudDirectoryClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-clouddirectory/pagination/ListDirectoriesPaginator.ts b/clients/client-clouddirectory/pagination/ListDirectoriesPaginator.ts new file mode 100644 index 0000000000000..97e16d573f64f --- /dev/null +++ b/clients/client-clouddirectory/pagination/ListDirectoriesPaginator.ts @@ -0,0 +1,51 @@ +import { CloudDirectory } from "../CloudDirectory"; +import { CloudDirectoryClient } from "../CloudDirectoryClient"; +import { + ListDirectoriesCommand, + ListDirectoriesCommandInput, + ListDirectoriesCommandOutput, +} from "../commands/ListDirectoriesCommand"; +import { CloudDirectoryPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudDirectoryClient, + input: ListDirectoriesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDirectoriesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudDirectory, + input: ListDirectoriesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDirectories(input, ...args); +}; +export async function* listDirectoriesPaginate( + config: CloudDirectoryPaginationConfiguration, + input: ListDirectoriesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDirectoriesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof CloudDirectory) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudDirectoryClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudDirectory | CloudDirectoryClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-clouddirectory/pagination/ListFacetAttributesPaginator.ts b/clients/client-clouddirectory/pagination/ListFacetAttributesPaginator.ts new file mode 100644 index 0000000000000..1be8a8345b716 --- /dev/null +++ b/clients/client-clouddirectory/pagination/ListFacetAttributesPaginator.ts @@ -0,0 +1,51 @@ +import { CloudDirectory } from "../CloudDirectory"; +import { CloudDirectoryClient } from "../CloudDirectoryClient"; +import { + ListFacetAttributesCommand, + ListFacetAttributesCommandInput, + ListFacetAttributesCommandOutput, +} from "../commands/ListFacetAttributesCommand"; +import { CloudDirectoryPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudDirectoryClient, + input: ListFacetAttributesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListFacetAttributesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudDirectory, + input: ListFacetAttributesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listFacetAttributes(input, ...args); +}; +export async function* listFacetAttributesPaginate( + config: CloudDirectoryPaginationConfiguration, + input: ListFacetAttributesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListFacetAttributesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof CloudDirectory) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudDirectoryClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudDirectory | CloudDirectoryClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-clouddirectory/pagination/ListFacetNamesPaginator.ts b/clients/client-clouddirectory/pagination/ListFacetNamesPaginator.ts new file mode 100644 index 0000000000000..bdad619f9875f --- /dev/null +++ b/clients/client-clouddirectory/pagination/ListFacetNamesPaginator.ts @@ -0,0 +1,51 @@ +import { CloudDirectory } from "../CloudDirectory"; +import { CloudDirectoryClient } from "../CloudDirectoryClient"; +import { + ListFacetNamesCommand, + ListFacetNamesCommandInput, + ListFacetNamesCommandOutput, +} from "../commands/ListFacetNamesCommand"; +import { CloudDirectoryPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudDirectoryClient, + input: ListFacetNamesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListFacetNamesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudDirectory, + input: ListFacetNamesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listFacetNames(input, ...args); +}; +export async function* listFacetNamesPaginate( + config: CloudDirectoryPaginationConfiguration, + input: ListFacetNamesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListFacetNamesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof CloudDirectory) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudDirectoryClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudDirectory | CloudDirectoryClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-clouddirectory/pagination/ListIndexPaginator.ts b/clients/client-clouddirectory/pagination/ListIndexPaginator.ts new file mode 100644 index 0000000000000..7f15dd32500db --- /dev/null +++ b/clients/client-clouddirectory/pagination/ListIndexPaginator.ts @@ -0,0 +1,47 @@ +import { CloudDirectory } from "../CloudDirectory"; +import { CloudDirectoryClient } from "../CloudDirectoryClient"; +import { ListIndexCommand, ListIndexCommandInput, ListIndexCommandOutput } from "../commands/ListIndexCommand"; +import { CloudDirectoryPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudDirectoryClient, + input: ListIndexCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListIndexCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudDirectory, + input: ListIndexCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listIndex(input, ...args); +}; +export async function* listIndexPaginate( + config: CloudDirectoryPaginationConfiguration, + input: ListIndexCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListIndexCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof CloudDirectory) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudDirectoryClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudDirectory | CloudDirectoryClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-clouddirectory/pagination/ListManagedSchemaArnsPaginator.ts b/clients/client-clouddirectory/pagination/ListManagedSchemaArnsPaginator.ts new file mode 100644 index 0000000000000..3f40cdeb431e3 --- /dev/null +++ b/clients/client-clouddirectory/pagination/ListManagedSchemaArnsPaginator.ts @@ -0,0 +1,51 @@ +import { CloudDirectory } from "../CloudDirectory"; +import { CloudDirectoryClient } from "../CloudDirectoryClient"; +import { + ListManagedSchemaArnsCommand, + ListManagedSchemaArnsCommandInput, + ListManagedSchemaArnsCommandOutput, +} from "../commands/ListManagedSchemaArnsCommand"; +import { CloudDirectoryPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudDirectoryClient, + input: ListManagedSchemaArnsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListManagedSchemaArnsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudDirectory, + input: ListManagedSchemaArnsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listManagedSchemaArns(input, ...args); +}; +export async function* listManagedSchemaArnsPaginate( + config: CloudDirectoryPaginationConfiguration, + input: ListManagedSchemaArnsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListManagedSchemaArnsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof CloudDirectory) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudDirectoryClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudDirectory | CloudDirectoryClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-clouddirectory/pagination/ListObjectAttributesPaginator.ts b/clients/client-clouddirectory/pagination/ListObjectAttributesPaginator.ts new file mode 100644 index 0000000000000..297613034471f --- /dev/null +++ b/clients/client-clouddirectory/pagination/ListObjectAttributesPaginator.ts @@ -0,0 +1,51 @@ +import { CloudDirectory } from "../CloudDirectory"; +import { CloudDirectoryClient } from "../CloudDirectoryClient"; +import { + ListObjectAttributesCommand, + ListObjectAttributesCommandInput, + ListObjectAttributesCommandOutput, +} from "../commands/ListObjectAttributesCommand"; +import { CloudDirectoryPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudDirectoryClient, + input: ListObjectAttributesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListObjectAttributesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudDirectory, + input: ListObjectAttributesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listObjectAttributes(input, ...args); +}; +export async function* listObjectAttributesPaginate( + config: CloudDirectoryPaginationConfiguration, + input: ListObjectAttributesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListObjectAttributesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof CloudDirectory) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudDirectoryClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudDirectory | CloudDirectoryClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-clouddirectory/pagination/ListObjectChildrenPaginator.ts b/clients/client-clouddirectory/pagination/ListObjectChildrenPaginator.ts new file mode 100644 index 0000000000000..35c9dd2480608 --- /dev/null +++ b/clients/client-clouddirectory/pagination/ListObjectChildrenPaginator.ts @@ -0,0 +1,51 @@ +import { CloudDirectory } from "../CloudDirectory"; +import { CloudDirectoryClient } from "../CloudDirectoryClient"; +import { + ListObjectChildrenCommand, + ListObjectChildrenCommandInput, + ListObjectChildrenCommandOutput, +} from "../commands/ListObjectChildrenCommand"; +import { CloudDirectoryPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudDirectoryClient, + input: ListObjectChildrenCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListObjectChildrenCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudDirectory, + input: ListObjectChildrenCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listObjectChildren(input, ...args); +}; +export async function* listObjectChildrenPaginate( + config: CloudDirectoryPaginationConfiguration, + input: ListObjectChildrenCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListObjectChildrenCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof CloudDirectory) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudDirectoryClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudDirectory | CloudDirectoryClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-clouddirectory/pagination/ListObjectParentPathsPaginator.ts b/clients/client-clouddirectory/pagination/ListObjectParentPathsPaginator.ts new file mode 100644 index 0000000000000..83369c68e7301 --- /dev/null +++ b/clients/client-clouddirectory/pagination/ListObjectParentPathsPaginator.ts @@ -0,0 +1,51 @@ +import { CloudDirectory } from "../CloudDirectory"; +import { CloudDirectoryClient } from "../CloudDirectoryClient"; +import { + ListObjectParentPathsCommand, + ListObjectParentPathsCommandInput, + ListObjectParentPathsCommandOutput, +} from "../commands/ListObjectParentPathsCommand"; +import { CloudDirectoryPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudDirectoryClient, + input: ListObjectParentPathsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListObjectParentPathsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudDirectory, + input: ListObjectParentPathsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listObjectParentPaths(input, ...args); +}; +export async function* listObjectParentPathsPaginate( + config: CloudDirectoryPaginationConfiguration, + input: ListObjectParentPathsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListObjectParentPathsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof CloudDirectory) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudDirectoryClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudDirectory | CloudDirectoryClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-clouddirectory/pagination/ListObjectParentsPaginator.ts b/clients/client-clouddirectory/pagination/ListObjectParentsPaginator.ts new file mode 100644 index 0000000000000..8333e80a531d7 --- /dev/null +++ b/clients/client-clouddirectory/pagination/ListObjectParentsPaginator.ts @@ -0,0 +1,51 @@ +import { CloudDirectory } from "../CloudDirectory"; +import { CloudDirectoryClient } from "../CloudDirectoryClient"; +import { + ListObjectParentsCommand, + ListObjectParentsCommandInput, + ListObjectParentsCommandOutput, +} from "../commands/ListObjectParentsCommand"; +import { CloudDirectoryPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudDirectoryClient, + input: ListObjectParentsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListObjectParentsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudDirectory, + input: ListObjectParentsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listObjectParents(input, ...args); +}; +export async function* listObjectParentsPaginate( + config: CloudDirectoryPaginationConfiguration, + input: ListObjectParentsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListObjectParentsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof CloudDirectory) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudDirectoryClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudDirectory | CloudDirectoryClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-clouddirectory/pagination/ListObjectPoliciesPaginator.ts b/clients/client-clouddirectory/pagination/ListObjectPoliciesPaginator.ts new file mode 100644 index 0000000000000..cae3ba80f4989 --- /dev/null +++ b/clients/client-clouddirectory/pagination/ListObjectPoliciesPaginator.ts @@ -0,0 +1,51 @@ +import { CloudDirectory } from "../CloudDirectory"; +import { CloudDirectoryClient } from "../CloudDirectoryClient"; +import { + ListObjectPoliciesCommand, + ListObjectPoliciesCommandInput, + ListObjectPoliciesCommandOutput, +} from "../commands/ListObjectPoliciesCommand"; +import { CloudDirectoryPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudDirectoryClient, + input: ListObjectPoliciesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListObjectPoliciesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudDirectory, + input: ListObjectPoliciesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listObjectPolicies(input, ...args); +}; +export async function* listObjectPoliciesPaginate( + config: CloudDirectoryPaginationConfiguration, + input: ListObjectPoliciesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListObjectPoliciesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof CloudDirectory) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudDirectoryClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudDirectory | CloudDirectoryClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-clouddirectory/pagination/ListPolicyAttachmentsPaginator.ts b/clients/client-clouddirectory/pagination/ListPolicyAttachmentsPaginator.ts new file mode 100644 index 0000000000000..665b3f9a0dac7 --- /dev/null +++ b/clients/client-clouddirectory/pagination/ListPolicyAttachmentsPaginator.ts @@ -0,0 +1,51 @@ +import { CloudDirectory } from "../CloudDirectory"; +import { CloudDirectoryClient } from "../CloudDirectoryClient"; +import { + ListPolicyAttachmentsCommand, + ListPolicyAttachmentsCommandInput, + ListPolicyAttachmentsCommandOutput, +} from "../commands/ListPolicyAttachmentsCommand"; +import { CloudDirectoryPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudDirectoryClient, + input: ListPolicyAttachmentsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListPolicyAttachmentsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudDirectory, + input: ListPolicyAttachmentsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listPolicyAttachments(input, ...args); +}; +export async function* listPolicyAttachmentsPaginate( + config: CloudDirectoryPaginationConfiguration, + input: ListPolicyAttachmentsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListPolicyAttachmentsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof CloudDirectory) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudDirectoryClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudDirectory | CloudDirectoryClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-clouddirectory/pagination/ListPublishedSchemaArnsPaginator.ts b/clients/client-clouddirectory/pagination/ListPublishedSchemaArnsPaginator.ts new file mode 100644 index 0000000000000..f9da6be976767 --- /dev/null +++ b/clients/client-clouddirectory/pagination/ListPublishedSchemaArnsPaginator.ts @@ -0,0 +1,51 @@ +import { CloudDirectory } from "../CloudDirectory"; +import { CloudDirectoryClient } from "../CloudDirectoryClient"; +import { + ListPublishedSchemaArnsCommand, + ListPublishedSchemaArnsCommandInput, + ListPublishedSchemaArnsCommandOutput, +} from "../commands/ListPublishedSchemaArnsCommand"; +import { CloudDirectoryPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudDirectoryClient, + input: ListPublishedSchemaArnsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListPublishedSchemaArnsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudDirectory, + input: ListPublishedSchemaArnsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listPublishedSchemaArns(input, ...args); +}; +export async function* listPublishedSchemaArnsPaginate( + config: CloudDirectoryPaginationConfiguration, + input: ListPublishedSchemaArnsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListPublishedSchemaArnsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof CloudDirectory) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudDirectoryClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudDirectory | CloudDirectoryClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-clouddirectory/pagination/ListTagsForResourcePaginator.ts b/clients/client-clouddirectory/pagination/ListTagsForResourcePaginator.ts new file mode 100644 index 0000000000000..6cd86e2e007b1 --- /dev/null +++ b/clients/client-clouddirectory/pagination/ListTagsForResourcePaginator.ts @@ -0,0 +1,51 @@ +import { CloudDirectory } from "../CloudDirectory"; +import { CloudDirectoryClient } from "../CloudDirectoryClient"; +import { + ListTagsForResourceCommand, + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput, +} from "../commands/ListTagsForResourceCommand"; +import { CloudDirectoryPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudDirectoryClient, + input: ListTagsForResourceCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTagsForResourceCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudDirectory, + input: ListTagsForResourceCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTagsForResource(input, ...args); +}; +export async function* listTagsForResourcePaginate( + config: CloudDirectoryPaginationConfiguration, + input: ListTagsForResourceCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTagsForResourceCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof CloudDirectory) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudDirectoryClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudDirectory | CloudDirectoryClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-clouddirectory/pagination/ListTypedLinkFacetAttributesPaginator.ts b/clients/client-clouddirectory/pagination/ListTypedLinkFacetAttributesPaginator.ts new file mode 100644 index 0000000000000..7f99ba9700866 --- /dev/null +++ b/clients/client-clouddirectory/pagination/ListTypedLinkFacetAttributesPaginator.ts @@ -0,0 +1,51 @@ +import { CloudDirectory } from "../CloudDirectory"; +import { CloudDirectoryClient } from "../CloudDirectoryClient"; +import { + ListTypedLinkFacetAttributesCommand, + ListTypedLinkFacetAttributesCommandInput, + ListTypedLinkFacetAttributesCommandOutput, +} from "../commands/ListTypedLinkFacetAttributesCommand"; +import { CloudDirectoryPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudDirectoryClient, + input: ListTypedLinkFacetAttributesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTypedLinkFacetAttributesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudDirectory, + input: ListTypedLinkFacetAttributesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTypedLinkFacetAttributes(input, ...args); +}; +export async function* listTypedLinkFacetAttributesPaginate( + config: CloudDirectoryPaginationConfiguration, + input: ListTypedLinkFacetAttributesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTypedLinkFacetAttributesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof CloudDirectory) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudDirectoryClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudDirectory | CloudDirectoryClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-clouddirectory/pagination/ListTypedLinkFacetNamesPaginator.ts b/clients/client-clouddirectory/pagination/ListTypedLinkFacetNamesPaginator.ts new file mode 100644 index 0000000000000..0c0c226f08655 --- /dev/null +++ b/clients/client-clouddirectory/pagination/ListTypedLinkFacetNamesPaginator.ts @@ -0,0 +1,51 @@ +import { CloudDirectory } from "../CloudDirectory"; +import { CloudDirectoryClient } from "../CloudDirectoryClient"; +import { + ListTypedLinkFacetNamesCommand, + ListTypedLinkFacetNamesCommandInput, + ListTypedLinkFacetNamesCommandOutput, +} from "../commands/ListTypedLinkFacetNamesCommand"; +import { CloudDirectoryPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudDirectoryClient, + input: ListTypedLinkFacetNamesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTypedLinkFacetNamesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudDirectory, + input: ListTypedLinkFacetNamesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTypedLinkFacetNames(input, ...args); +}; +export async function* listTypedLinkFacetNamesPaginate( + config: CloudDirectoryPaginationConfiguration, + input: ListTypedLinkFacetNamesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTypedLinkFacetNamesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof CloudDirectory) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudDirectoryClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudDirectory | CloudDirectoryClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-clouddirectory/pagination/LookupPolicyPaginator.ts b/clients/client-clouddirectory/pagination/LookupPolicyPaginator.ts new file mode 100644 index 0000000000000..e6fada2234120 --- /dev/null +++ b/clients/client-clouddirectory/pagination/LookupPolicyPaginator.ts @@ -0,0 +1,51 @@ +import { CloudDirectory } from "../CloudDirectory"; +import { CloudDirectoryClient } from "../CloudDirectoryClient"; +import { + LookupPolicyCommand, + LookupPolicyCommandInput, + LookupPolicyCommandOutput, +} from "../commands/LookupPolicyCommand"; +import { CloudDirectoryPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudDirectoryClient, + input: LookupPolicyCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new LookupPolicyCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudDirectory, + input: LookupPolicyCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.lookupPolicy(input, ...args); +}; +export async function* lookupPolicyPaginate( + config: CloudDirectoryPaginationConfiguration, + input: LookupPolicyCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: LookupPolicyCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof CloudDirectory) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudDirectoryClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudDirectory | CloudDirectoryClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-cloudformation/index.ts b/clients/client-cloudformation/index.ts index 57cc198425729..f914478a61667 100644 --- a/clients/client-cloudformation/index.ts +++ b/clients/client-cloudformation/index.ts @@ -12,14 +12,18 @@ export * from "./commands/DeleteStackInstancesCommand"; export * from "./commands/DeleteStackSetCommand"; export * from "./commands/DeregisterTypeCommand"; export * from "./commands/DescribeAccountLimitsCommand"; +export * from "./pagination/DescribeAccountLimitsPaginator"; export * from "./commands/DescribeChangeSetCommand"; export * from "./commands/DescribeStackDriftDetectionStatusCommand"; export * from "./commands/DescribeStackEventsCommand"; +export * from "./pagination/DescribeStackEventsPaginator"; export * from "./commands/DescribeStackInstanceCommand"; export * from "./commands/DescribeStackResourceCommand"; export * from "./commands/DescribeStackResourceDriftsCommand"; +export * from "./pagination/DescribeStackResourceDriftsPaginator"; export * from "./commands/DescribeStackResourcesCommand"; export * from "./commands/DescribeStacksCommand"; +export * from "./pagination/DescribeStacksPaginator"; export * from "./commands/DescribeStackSetCommand"; export * from "./commands/DescribeStackSetOperationCommand"; export * from "./commands/DescribeTypeCommand"; @@ -33,17 +37,25 @@ export * from "./commands/GetStackPolicyCommand"; export * from "./commands/GetTemplateCommand"; export * from "./commands/GetTemplateSummaryCommand"; export * from "./commands/ListChangeSetsCommand"; +export * from "./pagination/ListChangeSetsPaginator"; export * from "./commands/ListExportsCommand"; +export * from "./pagination/ListExportsPaginator"; export * from "./commands/ListImportsCommand"; +export * from "./pagination/ListImportsPaginator"; export * from "./commands/ListStackInstancesCommand"; export * from "./commands/ListStackResourcesCommand"; +export * from "./pagination/ListStackResourcesPaginator"; export * from "./commands/ListStacksCommand"; +export * from "./pagination/ListStacksPaginator"; export * from "./commands/ListStackSetOperationResultsCommand"; export * from "./commands/ListStackSetOperationsCommand"; export * from "./commands/ListStackSetsCommand"; export * from "./commands/ListTypeRegistrationsCommand"; +export * from "./pagination/ListTypeRegistrationsPaginator"; export * from "./commands/ListTypesCommand"; +export * from "./pagination/ListTypesPaginator"; export * from "./commands/ListTypeVersionsCommand"; +export * from "./pagination/ListTypeVersionsPaginator"; export * from "./commands/RecordHandlerProgressCommand"; export * from "./commands/RegisterTypeCommand"; export * from "./commands/SetStackPolicyCommand"; @@ -55,4 +67,5 @@ export * from "./commands/UpdateStackInstancesCommand"; export * from "./commands/UpdateStackSetCommand"; export * from "./commands/UpdateTerminationProtectionCommand"; export * from "./commands/ValidateTemplateCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-cloudformation/pagination/DescribeAccountLimitsPaginator.ts b/clients/client-cloudformation/pagination/DescribeAccountLimitsPaginator.ts new file mode 100644 index 0000000000000..4706c2cdf798e --- /dev/null +++ b/clients/client-cloudformation/pagination/DescribeAccountLimitsPaginator.ts @@ -0,0 +1,50 @@ +import { CloudFormation } from "../CloudFormation"; +import { CloudFormationClient } from "../CloudFormationClient"; +import { + DescribeAccountLimitsCommand, + DescribeAccountLimitsCommandInput, + DescribeAccountLimitsCommandOutput, +} from "../commands/DescribeAccountLimitsCommand"; +import { CloudFormationPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudFormationClient, + input: DescribeAccountLimitsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeAccountLimitsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudFormation, + input: DescribeAccountLimitsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeAccountLimits(input, ...args); +}; +export async function* describeAccountLimitsPaginate( + config: CloudFormationPaginationConfiguration, + input: DescribeAccountLimitsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeAccountLimitsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + if (config.client instanceof CloudFormation) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudFormationClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudFormation | CloudFormationClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-cloudformation/pagination/DescribeStackEventsPaginator.ts b/clients/client-cloudformation/pagination/DescribeStackEventsPaginator.ts new file mode 100644 index 0000000000000..d3b1d4abd2698 --- /dev/null +++ b/clients/client-cloudformation/pagination/DescribeStackEventsPaginator.ts @@ -0,0 +1,50 @@ +import { CloudFormation } from "../CloudFormation"; +import { CloudFormationClient } from "../CloudFormationClient"; +import { + DescribeStackEventsCommand, + DescribeStackEventsCommandInput, + DescribeStackEventsCommandOutput, +} from "../commands/DescribeStackEventsCommand"; +import { CloudFormationPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudFormationClient, + input: DescribeStackEventsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeStackEventsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudFormation, + input: DescribeStackEventsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeStackEvents(input, ...args); +}; +export async function* describeStackEventsPaginate( + config: CloudFormationPaginationConfiguration, + input: DescribeStackEventsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeStackEventsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + if (config.client instanceof CloudFormation) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudFormationClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudFormation | CloudFormationClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-cloudformation/pagination/DescribeStackResourceDriftsPaginator.ts b/clients/client-cloudformation/pagination/DescribeStackResourceDriftsPaginator.ts new file mode 100644 index 0000000000000..d3e0782a13d4b --- /dev/null +++ b/clients/client-cloudformation/pagination/DescribeStackResourceDriftsPaginator.ts @@ -0,0 +1,51 @@ +import { CloudFormation } from "../CloudFormation"; +import { CloudFormationClient } from "../CloudFormationClient"; +import { + DescribeStackResourceDriftsCommand, + DescribeStackResourceDriftsCommandInput, + DescribeStackResourceDriftsCommandOutput, +} from "../commands/DescribeStackResourceDriftsCommand"; +import { CloudFormationPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudFormationClient, + input: DescribeStackResourceDriftsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeStackResourceDriftsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudFormation, + input: DescribeStackResourceDriftsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeStackResourceDrifts(input, ...args); +}; +export async function* describeStackResourceDriftsPaginate( + config: CloudFormationPaginationConfiguration, + input: DescribeStackResourceDriftsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeStackResourceDriftsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof CloudFormation) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudFormationClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudFormation | CloudFormationClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-cloudformation/pagination/DescribeStacksPaginator.ts b/clients/client-cloudformation/pagination/DescribeStacksPaginator.ts new file mode 100644 index 0000000000000..8c0d52aff59be --- /dev/null +++ b/clients/client-cloudformation/pagination/DescribeStacksPaginator.ts @@ -0,0 +1,50 @@ +import { CloudFormation } from "../CloudFormation"; +import { CloudFormationClient } from "../CloudFormationClient"; +import { + DescribeStacksCommand, + DescribeStacksCommandInput, + DescribeStacksCommandOutput, +} from "../commands/DescribeStacksCommand"; +import { CloudFormationPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudFormationClient, + input: DescribeStacksCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeStacksCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudFormation, + input: DescribeStacksCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeStacks(input, ...args); +}; +export async function* describeStacksPaginate( + config: CloudFormationPaginationConfiguration, + input: DescribeStacksCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeStacksCommandOutput; + while (hasNext) { + input["NextToken"] = token; + if (config.client instanceof CloudFormation) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudFormationClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudFormation | CloudFormationClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-cloudformation/pagination/Interfaces.ts b/clients/client-cloudformation/pagination/Interfaces.ts new file mode 100644 index 0000000000000..21ad9bcef67a0 --- /dev/null +++ b/clients/client-cloudformation/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { CloudFormation } from "../CloudFormation"; +import { CloudFormationClient } from "../CloudFormationClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface CloudFormationPaginationConfiguration extends PaginationConfiguration { + client: CloudFormation | CloudFormationClient; +} diff --git a/clients/client-cloudformation/pagination/ListChangeSetsPaginator.ts b/clients/client-cloudformation/pagination/ListChangeSetsPaginator.ts new file mode 100644 index 0000000000000..55ef09f7ba630 --- /dev/null +++ b/clients/client-cloudformation/pagination/ListChangeSetsPaginator.ts @@ -0,0 +1,50 @@ +import { CloudFormation } from "../CloudFormation"; +import { CloudFormationClient } from "../CloudFormationClient"; +import { + ListChangeSetsCommand, + ListChangeSetsCommandInput, + ListChangeSetsCommandOutput, +} from "../commands/ListChangeSetsCommand"; +import { CloudFormationPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudFormationClient, + input: ListChangeSetsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListChangeSetsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudFormation, + input: ListChangeSetsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listChangeSets(input, ...args); +}; +export async function* listChangeSetsPaginate( + config: CloudFormationPaginationConfiguration, + input: ListChangeSetsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListChangeSetsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + if (config.client instanceof CloudFormation) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudFormationClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudFormation | CloudFormationClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-cloudformation/pagination/ListExportsPaginator.ts b/clients/client-cloudformation/pagination/ListExportsPaginator.ts new file mode 100644 index 0000000000000..c3cf6eb495866 --- /dev/null +++ b/clients/client-cloudformation/pagination/ListExportsPaginator.ts @@ -0,0 +1,46 @@ +import { CloudFormation } from "../CloudFormation"; +import { CloudFormationClient } from "../CloudFormationClient"; +import { ListExportsCommand, ListExportsCommandInput, ListExportsCommandOutput } from "../commands/ListExportsCommand"; +import { CloudFormationPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudFormationClient, + input: ListExportsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListExportsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudFormation, + input: ListExportsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listExports(input, ...args); +}; +export async function* listExportsPaginate( + config: CloudFormationPaginationConfiguration, + input: ListExportsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListExportsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + if (config.client instanceof CloudFormation) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudFormationClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudFormation | CloudFormationClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-cloudformation/pagination/ListImportsPaginator.ts b/clients/client-cloudformation/pagination/ListImportsPaginator.ts new file mode 100644 index 0000000000000..2c35423ccaac6 --- /dev/null +++ b/clients/client-cloudformation/pagination/ListImportsPaginator.ts @@ -0,0 +1,46 @@ +import { CloudFormation } from "../CloudFormation"; +import { CloudFormationClient } from "../CloudFormationClient"; +import { ListImportsCommand, ListImportsCommandInput, ListImportsCommandOutput } from "../commands/ListImportsCommand"; +import { CloudFormationPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudFormationClient, + input: ListImportsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListImportsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudFormation, + input: ListImportsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listImports(input, ...args); +}; +export async function* listImportsPaginate( + config: CloudFormationPaginationConfiguration, + input: ListImportsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListImportsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + if (config.client instanceof CloudFormation) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudFormationClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudFormation | CloudFormationClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-cloudformation/pagination/ListStackResourcesPaginator.ts b/clients/client-cloudformation/pagination/ListStackResourcesPaginator.ts new file mode 100644 index 0000000000000..ac527b1b6c290 --- /dev/null +++ b/clients/client-cloudformation/pagination/ListStackResourcesPaginator.ts @@ -0,0 +1,50 @@ +import { CloudFormation } from "../CloudFormation"; +import { CloudFormationClient } from "../CloudFormationClient"; +import { + ListStackResourcesCommand, + ListStackResourcesCommandInput, + ListStackResourcesCommandOutput, +} from "../commands/ListStackResourcesCommand"; +import { CloudFormationPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudFormationClient, + input: ListStackResourcesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListStackResourcesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudFormation, + input: ListStackResourcesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listStackResources(input, ...args); +}; +export async function* listStackResourcesPaginate( + config: CloudFormationPaginationConfiguration, + input: ListStackResourcesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListStackResourcesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + if (config.client instanceof CloudFormation) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudFormationClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudFormation | CloudFormationClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-cloudformation/pagination/ListStacksPaginator.ts b/clients/client-cloudformation/pagination/ListStacksPaginator.ts new file mode 100644 index 0000000000000..5cb50bc8e8f2a --- /dev/null +++ b/clients/client-cloudformation/pagination/ListStacksPaginator.ts @@ -0,0 +1,46 @@ +import { CloudFormation } from "../CloudFormation"; +import { CloudFormationClient } from "../CloudFormationClient"; +import { ListStacksCommand, ListStacksCommandInput, ListStacksCommandOutput } from "../commands/ListStacksCommand"; +import { CloudFormationPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudFormationClient, + input: ListStacksCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListStacksCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudFormation, + input: ListStacksCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listStacks(input, ...args); +}; +export async function* listStacksPaginate( + config: CloudFormationPaginationConfiguration, + input: ListStacksCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListStacksCommandOutput; + while (hasNext) { + input["NextToken"] = token; + if (config.client instanceof CloudFormation) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudFormationClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudFormation | CloudFormationClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-cloudformation/pagination/ListTypeRegistrationsPaginator.ts b/clients/client-cloudformation/pagination/ListTypeRegistrationsPaginator.ts new file mode 100644 index 0000000000000..9755630b8eb6b --- /dev/null +++ b/clients/client-cloudformation/pagination/ListTypeRegistrationsPaginator.ts @@ -0,0 +1,51 @@ +import { CloudFormation } from "../CloudFormation"; +import { CloudFormationClient } from "../CloudFormationClient"; +import { + ListTypeRegistrationsCommand, + ListTypeRegistrationsCommandInput, + ListTypeRegistrationsCommandOutput, +} from "../commands/ListTypeRegistrationsCommand"; +import { CloudFormationPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudFormationClient, + input: ListTypeRegistrationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTypeRegistrationsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudFormation, + input: ListTypeRegistrationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTypeRegistrations(input, ...args); +}; +export async function* listTypeRegistrationsPaginate( + config: CloudFormationPaginationConfiguration, + input: ListTypeRegistrationsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTypeRegistrationsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof CloudFormation) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudFormationClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudFormation | CloudFormationClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-cloudformation/pagination/ListTypeVersionsPaginator.ts b/clients/client-cloudformation/pagination/ListTypeVersionsPaginator.ts new file mode 100644 index 0000000000000..330c462fcc13b --- /dev/null +++ b/clients/client-cloudformation/pagination/ListTypeVersionsPaginator.ts @@ -0,0 +1,51 @@ +import { CloudFormation } from "../CloudFormation"; +import { CloudFormationClient } from "../CloudFormationClient"; +import { + ListTypeVersionsCommand, + ListTypeVersionsCommandInput, + ListTypeVersionsCommandOutput, +} from "../commands/ListTypeVersionsCommand"; +import { CloudFormationPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudFormationClient, + input: ListTypeVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTypeVersionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudFormation, + input: ListTypeVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTypeVersions(input, ...args); +}; +export async function* listTypeVersionsPaginate( + config: CloudFormationPaginationConfiguration, + input: ListTypeVersionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTypeVersionsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof CloudFormation) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudFormationClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudFormation | CloudFormationClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-cloudformation/pagination/ListTypesPaginator.ts b/clients/client-cloudformation/pagination/ListTypesPaginator.ts new file mode 100644 index 0000000000000..31993108ce112 --- /dev/null +++ b/clients/client-cloudformation/pagination/ListTypesPaginator.ts @@ -0,0 +1,47 @@ +import { CloudFormation } from "../CloudFormation"; +import { CloudFormationClient } from "../CloudFormationClient"; +import { ListTypesCommand, ListTypesCommandInput, ListTypesCommandOutput } from "../commands/ListTypesCommand"; +import { CloudFormationPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudFormationClient, + input: ListTypesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTypesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudFormation, + input: ListTypesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTypes(input, ...args); +}; +export async function* listTypesPaginate( + config: CloudFormationPaginationConfiguration, + input: ListTypesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTypesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof CloudFormation) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudFormationClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudFormation | CloudFormationClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-cloudhsm-v2/index.ts b/clients/client-cloudhsm-v2/index.ts index 565d6b25bbeba..a9d65f7689ef4 100644 --- a/clients/client-cloudhsm-v2/index.ts +++ b/clients/client-cloudhsm-v2/index.ts @@ -7,10 +7,14 @@ export * from "./commands/DeleteBackupCommand"; export * from "./commands/DeleteClusterCommand"; export * from "./commands/DeleteHsmCommand"; export * from "./commands/DescribeBackupsCommand"; +export * from "./pagination/DescribeBackupsPaginator"; export * from "./commands/DescribeClustersCommand"; +export * from "./pagination/DescribeClustersPaginator"; export * from "./commands/InitializeClusterCommand"; export * from "./commands/ListTagsCommand"; +export * from "./pagination/ListTagsPaginator"; export * from "./commands/RestoreBackupCommand"; export * from "./commands/TagResourceCommand"; export * from "./commands/UntagResourceCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-cloudhsm-v2/pagination/DescribeBackupsPaginator.ts b/clients/client-cloudhsm-v2/pagination/DescribeBackupsPaginator.ts new file mode 100644 index 0000000000000..61036c3acb173 --- /dev/null +++ b/clients/client-cloudhsm-v2/pagination/DescribeBackupsPaginator.ts @@ -0,0 +1,51 @@ +import { CloudHSMV2 } from "../CloudHSMV2"; +import { CloudHSMV2Client } from "../CloudHSMV2Client"; +import { + DescribeBackupsCommand, + DescribeBackupsCommandInput, + DescribeBackupsCommandOutput, +} from "../commands/DescribeBackupsCommand"; +import { CloudHSMV2PaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudHSMV2Client, + input: DescribeBackupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeBackupsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudHSMV2, + input: DescribeBackupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeBackups(input, ...args); +}; +export async function* describeBackupsPaginate( + config: CloudHSMV2PaginationConfiguration, + input: DescribeBackupsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeBackupsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof CloudHSMV2) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudHSMV2Client) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudHSMV2 | CloudHSMV2Client"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-cloudhsm-v2/pagination/DescribeClustersPaginator.ts b/clients/client-cloudhsm-v2/pagination/DescribeClustersPaginator.ts new file mode 100644 index 0000000000000..e1df8f1026eea --- /dev/null +++ b/clients/client-cloudhsm-v2/pagination/DescribeClustersPaginator.ts @@ -0,0 +1,51 @@ +import { CloudHSMV2 } from "../CloudHSMV2"; +import { CloudHSMV2Client } from "../CloudHSMV2Client"; +import { + DescribeClustersCommand, + DescribeClustersCommandInput, + DescribeClustersCommandOutput, +} from "../commands/DescribeClustersCommand"; +import { CloudHSMV2PaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudHSMV2Client, + input: DescribeClustersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeClustersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudHSMV2, + input: DescribeClustersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeClusters(input, ...args); +}; +export async function* describeClustersPaginate( + config: CloudHSMV2PaginationConfiguration, + input: DescribeClustersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeClustersCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof CloudHSMV2) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudHSMV2Client) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudHSMV2 | CloudHSMV2Client"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-cloudhsm-v2/pagination/Interfaces.ts b/clients/client-cloudhsm-v2/pagination/Interfaces.ts new file mode 100644 index 0000000000000..1ed410761d802 --- /dev/null +++ b/clients/client-cloudhsm-v2/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { CloudHSMV2 } from "../CloudHSMV2"; +import { CloudHSMV2Client } from "../CloudHSMV2Client"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface CloudHSMV2PaginationConfiguration extends PaginationConfiguration { + client: CloudHSMV2 | CloudHSMV2Client; +} diff --git a/clients/client-cloudhsm-v2/pagination/ListTagsPaginator.ts b/clients/client-cloudhsm-v2/pagination/ListTagsPaginator.ts new file mode 100644 index 0000000000000..290c8324821db --- /dev/null +++ b/clients/client-cloudhsm-v2/pagination/ListTagsPaginator.ts @@ -0,0 +1,47 @@ +import { CloudHSMV2 } from "../CloudHSMV2"; +import { CloudHSMV2Client } from "../CloudHSMV2Client"; +import { ListTagsCommand, ListTagsCommandInput, ListTagsCommandOutput } from "../commands/ListTagsCommand"; +import { CloudHSMV2PaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudHSMV2Client, + input: ListTagsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTagsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudHSMV2, + input: ListTagsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTags(input, ...args); +}; +export async function* listTagsPaginate( + config: CloudHSMV2PaginationConfiguration, + input: ListTagsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTagsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof CloudHSMV2) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudHSMV2Client) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudHSMV2 | CloudHSMV2Client"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-cloudtrail/index.ts b/clients/client-cloudtrail/index.ts index 140e63fcf0db9..e61b27dd6b6c7 100644 --- a/clients/client-cloudtrail/index.ts +++ b/clients/client-cloudtrail/index.ts @@ -9,13 +9,18 @@ export * from "./commands/GetInsightSelectorsCommand"; export * from "./commands/GetTrailCommand"; export * from "./commands/GetTrailStatusCommand"; export * from "./commands/ListPublicKeysCommand"; +export * from "./pagination/ListPublicKeysPaginator"; export * from "./commands/ListTagsCommand"; +export * from "./pagination/ListTagsPaginator"; export * from "./commands/ListTrailsCommand"; +export * from "./pagination/ListTrailsPaginator"; export * from "./commands/LookupEventsCommand"; +export * from "./pagination/LookupEventsPaginator"; export * from "./commands/PutEventSelectorsCommand"; export * from "./commands/PutInsightSelectorsCommand"; export * from "./commands/RemoveTagsCommand"; export * from "./commands/StartLoggingCommand"; export * from "./commands/StopLoggingCommand"; export * from "./commands/UpdateTrailCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-cloudtrail/pagination/Interfaces.ts b/clients/client-cloudtrail/pagination/Interfaces.ts new file mode 100644 index 0000000000000..f4a682f9a52f7 --- /dev/null +++ b/clients/client-cloudtrail/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { CloudTrail } from "../CloudTrail"; +import { CloudTrailClient } from "../CloudTrailClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface CloudTrailPaginationConfiguration extends PaginationConfiguration { + client: CloudTrail | CloudTrailClient; +} diff --git a/clients/client-cloudtrail/pagination/ListPublicKeysPaginator.ts b/clients/client-cloudtrail/pagination/ListPublicKeysPaginator.ts new file mode 100644 index 0000000000000..ad6a6efcdd7a7 --- /dev/null +++ b/clients/client-cloudtrail/pagination/ListPublicKeysPaginator.ts @@ -0,0 +1,50 @@ +import { CloudTrail } from "../CloudTrail"; +import { CloudTrailClient } from "../CloudTrailClient"; +import { + ListPublicKeysCommand, + ListPublicKeysCommandInput, + ListPublicKeysCommandOutput, +} from "../commands/ListPublicKeysCommand"; +import { CloudTrailPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudTrailClient, + input: ListPublicKeysCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListPublicKeysCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudTrail, + input: ListPublicKeysCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listPublicKeys(input, ...args); +}; +export async function* listPublicKeysPaginate( + config: CloudTrailPaginationConfiguration, + input: ListPublicKeysCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListPublicKeysCommandOutput; + while (hasNext) { + input["NextToken"] = token; + if (config.client instanceof CloudTrail) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudTrailClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudTrail | CloudTrailClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-cloudtrail/pagination/ListTagsPaginator.ts b/clients/client-cloudtrail/pagination/ListTagsPaginator.ts new file mode 100644 index 0000000000000..bc9b5787aa780 --- /dev/null +++ b/clients/client-cloudtrail/pagination/ListTagsPaginator.ts @@ -0,0 +1,46 @@ +import { CloudTrail } from "../CloudTrail"; +import { CloudTrailClient } from "../CloudTrailClient"; +import { ListTagsCommand, ListTagsCommandInput, ListTagsCommandOutput } from "../commands/ListTagsCommand"; +import { CloudTrailPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudTrailClient, + input: ListTagsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTagsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudTrail, + input: ListTagsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTags(input, ...args); +}; +export async function* listTagsPaginate( + config: CloudTrailPaginationConfiguration, + input: ListTagsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTagsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + if (config.client instanceof CloudTrail) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudTrailClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudTrail | CloudTrailClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-cloudtrail/pagination/ListTrailsPaginator.ts b/clients/client-cloudtrail/pagination/ListTrailsPaginator.ts new file mode 100644 index 0000000000000..b20105ba41f6b --- /dev/null +++ b/clients/client-cloudtrail/pagination/ListTrailsPaginator.ts @@ -0,0 +1,46 @@ +import { CloudTrail } from "../CloudTrail"; +import { CloudTrailClient } from "../CloudTrailClient"; +import { ListTrailsCommand, ListTrailsCommandInput, ListTrailsCommandOutput } from "../commands/ListTrailsCommand"; +import { CloudTrailPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudTrailClient, + input: ListTrailsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTrailsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudTrail, + input: ListTrailsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTrails(input, ...args); +}; +export async function* listTrailsPaginate( + config: CloudTrailPaginationConfiguration, + input: ListTrailsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTrailsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + if (config.client instanceof CloudTrail) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudTrailClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudTrail | CloudTrailClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-cloudtrail/pagination/LookupEventsPaginator.ts b/clients/client-cloudtrail/pagination/LookupEventsPaginator.ts new file mode 100644 index 0000000000000..eec841c77d7c2 --- /dev/null +++ b/clients/client-cloudtrail/pagination/LookupEventsPaginator.ts @@ -0,0 +1,51 @@ +import { CloudTrail } from "../CloudTrail"; +import { CloudTrailClient } from "../CloudTrailClient"; +import { + LookupEventsCommand, + LookupEventsCommandInput, + LookupEventsCommandOutput, +} from "../commands/LookupEventsCommand"; +import { CloudTrailPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudTrailClient, + input: LookupEventsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new LookupEventsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudTrail, + input: LookupEventsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.lookupEvents(input, ...args); +}; +export async function* lookupEventsPaginate( + config: CloudTrailPaginationConfiguration, + input: LookupEventsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: LookupEventsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof CloudTrail) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudTrailClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudTrail | CloudTrailClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-cloudwatch-logs/index.ts b/clients/client-cloudwatch-logs/index.ts index 6c223ccfe1267..8f8a991aab718 100644 --- a/clients/client-cloudwatch-logs/index.ts +++ b/clients/client-cloudwatch-logs/index.ts @@ -14,17 +14,24 @@ export * from "./commands/DeleteResourcePolicyCommand"; export * from "./commands/DeleteRetentionPolicyCommand"; export * from "./commands/DeleteSubscriptionFilterCommand"; export * from "./commands/DescribeDestinationsCommand"; +export * from "./pagination/DescribeDestinationsPaginator"; export * from "./commands/DescribeExportTasksCommand"; export * from "./commands/DescribeLogGroupsCommand"; +export * from "./pagination/DescribeLogGroupsPaginator"; export * from "./commands/DescribeLogStreamsCommand"; +export * from "./pagination/DescribeLogStreamsPaginator"; export * from "./commands/DescribeMetricFiltersCommand"; +export * from "./pagination/DescribeMetricFiltersPaginator"; export * from "./commands/DescribeQueriesCommand"; export * from "./commands/DescribeQueryDefinitionsCommand"; export * from "./commands/DescribeResourcePoliciesCommand"; export * from "./commands/DescribeSubscriptionFiltersCommand"; +export * from "./pagination/DescribeSubscriptionFiltersPaginator"; export * from "./commands/DisassociateKmsKeyCommand"; export * from "./commands/FilterLogEventsCommand"; +export * from "./pagination/FilterLogEventsPaginator"; export * from "./commands/GetLogEventsCommand"; +export * from "./pagination/GetLogEventsPaginator"; export * from "./commands/GetLogGroupFieldsCommand"; export * from "./commands/GetLogRecordCommand"; export * from "./commands/GetQueryResultsCommand"; @@ -42,4 +49,5 @@ export * from "./commands/StopQueryCommand"; export * from "./commands/TagLogGroupCommand"; export * from "./commands/TestMetricFilterCommand"; export * from "./commands/UntagLogGroupCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-cloudwatch-logs/pagination/DescribeDestinationsPaginator.ts b/clients/client-cloudwatch-logs/pagination/DescribeDestinationsPaginator.ts new file mode 100644 index 0000000000000..7fea035b163b3 --- /dev/null +++ b/clients/client-cloudwatch-logs/pagination/DescribeDestinationsPaginator.ts @@ -0,0 +1,51 @@ +import { CloudWatchLogs } from "../CloudWatchLogs"; +import { CloudWatchLogsClient } from "../CloudWatchLogsClient"; +import { + DescribeDestinationsCommand, + DescribeDestinationsCommandInput, + DescribeDestinationsCommandOutput, +} from "../commands/DescribeDestinationsCommand"; +import { CloudWatchLogsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudWatchLogsClient, + input: DescribeDestinationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeDestinationsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudWatchLogs, + input: DescribeDestinationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeDestinations(input, ...args); +}; +export async function* describeDestinationsPaginate( + config: CloudWatchLogsPaginationConfiguration, + input: DescribeDestinationsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeDestinationsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["limit"] = config.pageSize; + if (config.client instanceof CloudWatchLogs) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudWatchLogsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudWatchLogs | CloudWatchLogsClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-cloudwatch-logs/pagination/DescribeLogGroupsPaginator.ts b/clients/client-cloudwatch-logs/pagination/DescribeLogGroupsPaginator.ts new file mode 100644 index 0000000000000..5a2fb7c6ad685 --- /dev/null +++ b/clients/client-cloudwatch-logs/pagination/DescribeLogGroupsPaginator.ts @@ -0,0 +1,51 @@ +import { CloudWatchLogs } from "../CloudWatchLogs"; +import { CloudWatchLogsClient } from "../CloudWatchLogsClient"; +import { + DescribeLogGroupsCommand, + DescribeLogGroupsCommandInput, + DescribeLogGroupsCommandOutput, +} from "../commands/DescribeLogGroupsCommand"; +import { CloudWatchLogsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudWatchLogsClient, + input: DescribeLogGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeLogGroupsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudWatchLogs, + input: DescribeLogGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeLogGroups(input, ...args); +}; +export async function* describeLogGroupsPaginate( + config: CloudWatchLogsPaginationConfiguration, + input: DescribeLogGroupsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeLogGroupsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["limit"] = config.pageSize; + if (config.client instanceof CloudWatchLogs) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudWatchLogsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudWatchLogs | CloudWatchLogsClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-cloudwatch-logs/pagination/DescribeLogStreamsPaginator.ts b/clients/client-cloudwatch-logs/pagination/DescribeLogStreamsPaginator.ts new file mode 100644 index 0000000000000..59dee8ca3868e --- /dev/null +++ b/clients/client-cloudwatch-logs/pagination/DescribeLogStreamsPaginator.ts @@ -0,0 +1,51 @@ +import { CloudWatchLogs } from "../CloudWatchLogs"; +import { CloudWatchLogsClient } from "../CloudWatchLogsClient"; +import { + DescribeLogStreamsCommand, + DescribeLogStreamsCommandInput, + DescribeLogStreamsCommandOutput, +} from "../commands/DescribeLogStreamsCommand"; +import { CloudWatchLogsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudWatchLogsClient, + input: DescribeLogStreamsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeLogStreamsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudWatchLogs, + input: DescribeLogStreamsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeLogStreams(input, ...args); +}; +export async function* describeLogStreamsPaginate( + config: CloudWatchLogsPaginationConfiguration, + input: DescribeLogStreamsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeLogStreamsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["limit"] = config.pageSize; + if (config.client instanceof CloudWatchLogs) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudWatchLogsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudWatchLogs | CloudWatchLogsClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-cloudwatch-logs/pagination/DescribeMetricFiltersPaginator.ts b/clients/client-cloudwatch-logs/pagination/DescribeMetricFiltersPaginator.ts new file mode 100644 index 0000000000000..ad3944e560329 --- /dev/null +++ b/clients/client-cloudwatch-logs/pagination/DescribeMetricFiltersPaginator.ts @@ -0,0 +1,51 @@ +import { CloudWatchLogs } from "../CloudWatchLogs"; +import { CloudWatchLogsClient } from "../CloudWatchLogsClient"; +import { + DescribeMetricFiltersCommand, + DescribeMetricFiltersCommandInput, + DescribeMetricFiltersCommandOutput, +} from "../commands/DescribeMetricFiltersCommand"; +import { CloudWatchLogsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudWatchLogsClient, + input: DescribeMetricFiltersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeMetricFiltersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudWatchLogs, + input: DescribeMetricFiltersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeMetricFilters(input, ...args); +}; +export async function* describeMetricFiltersPaginate( + config: CloudWatchLogsPaginationConfiguration, + input: DescribeMetricFiltersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeMetricFiltersCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["limit"] = config.pageSize; + if (config.client instanceof CloudWatchLogs) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudWatchLogsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudWatchLogs | CloudWatchLogsClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-cloudwatch-logs/pagination/DescribeSubscriptionFiltersPaginator.ts b/clients/client-cloudwatch-logs/pagination/DescribeSubscriptionFiltersPaginator.ts new file mode 100644 index 0000000000000..7aa5f88e5ca23 --- /dev/null +++ b/clients/client-cloudwatch-logs/pagination/DescribeSubscriptionFiltersPaginator.ts @@ -0,0 +1,51 @@ +import { CloudWatchLogs } from "../CloudWatchLogs"; +import { CloudWatchLogsClient } from "../CloudWatchLogsClient"; +import { + DescribeSubscriptionFiltersCommand, + DescribeSubscriptionFiltersCommandInput, + DescribeSubscriptionFiltersCommandOutput, +} from "../commands/DescribeSubscriptionFiltersCommand"; +import { CloudWatchLogsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudWatchLogsClient, + input: DescribeSubscriptionFiltersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeSubscriptionFiltersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudWatchLogs, + input: DescribeSubscriptionFiltersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeSubscriptionFilters(input, ...args); +}; +export async function* describeSubscriptionFiltersPaginate( + config: CloudWatchLogsPaginationConfiguration, + input: DescribeSubscriptionFiltersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeSubscriptionFiltersCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["limit"] = config.pageSize; + if (config.client instanceof CloudWatchLogs) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudWatchLogsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudWatchLogs | CloudWatchLogsClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-cloudwatch-logs/pagination/FilterLogEventsPaginator.ts b/clients/client-cloudwatch-logs/pagination/FilterLogEventsPaginator.ts new file mode 100644 index 0000000000000..aee0fa98f66b5 --- /dev/null +++ b/clients/client-cloudwatch-logs/pagination/FilterLogEventsPaginator.ts @@ -0,0 +1,51 @@ +import { CloudWatchLogs } from "../CloudWatchLogs"; +import { CloudWatchLogsClient } from "../CloudWatchLogsClient"; +import { + FilterLogEventsCommand, + FilterLogEventsCommandInput, + FilterLogEventsCommandOutput, +} from "../commands/FilterLogEventsCommand"; +import { CloudWatchLogsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudWatchLogsClient, + input: FilterLogEventsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new FilterLogEventsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudWatchLogs, + input: FilterLogEventsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.filterLogEvents(input, ...args); +}; +export async function* filterLogEventsPaginate( + config: CloudWatchLogsPaginationConfiguration, + input: FilterLogEventsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: FilterLogEventsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["limit"] = config.pageSize; + if (config.client instanceof CloudWatchLogs) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudWatchLogsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudWatchLogs | CloudWatchLogsClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-cloudwatch-logs/pagination/GetLogEventsPaginator.ts b/clients/client-cloudwatch-logs/pagination/GetLogEventsPaginator.ts new file mode 100644 index 0000000000000..1ff1b1a376800 --- /dev/null +++ b/clients/client-cloudwatch-logs/pagination/GetLogEventsPaginator.ts @@ -0,0 +1,51 @@ +import { CloudWatchLogs } from "../CloudWatchLogs"; +import { CloudWatchLogsClient } from "../CloudWatchLogsClient"; +import { + GetLogEventsCommand, + GetLogEventsCommandInput, + GetLogEventsCommandOutput, +} from "../commands/GetLogEventsCommand"; +import { CloudWatchLogsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudWatchLogsClient, + input: GetLogEventsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetLogEventsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudWatchLogs, + input: GetLogEventsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getLogEvents(input, ...args); +}; +export async function* getLogEventsPaginate( + config: CloudWatchLogsPaginationConfiguration, + input: GetLogEventsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetLogEventsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["limit"] = config.pageSize; + if (config.client instanceof CloudWatchLogs) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudWatchLogsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudWatchLogs | CloudWatchLogsClient"); + } + yield page; + token = page["nextForwardToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-cloudwatch-logs/pagination/Interfaces.ts b/clients/client-cloudwatch-logs/pagination/Interfaces.ts new file mode 100644 index 0000000000000..aaa8d4bdfe7ae --- /dev/null +++ b/clients/client-cloudwatch-logs/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { CloudWatchLogs } from "../CloudWatchLogs"; +import { CloudWatchLogsClient } from "../CloudWatchLogsClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface CloudWatchLogsPaginationConfiguration extends PaginationConfiguration { + client: CloudWatchLogs | CloudWatchLogsClient; +} diff --git a/clients/client-cloudwatch/index.ts b/clients/client-cloudwatch/index.ts index 2dd2b26ef485b..b48f6419d811d 100644 --- a/clients/client-cloudwatch/index.ts +++ b/clients/client-cloudwatch/index.ts @@ -5,10 +5,13 @@ export * from "./commands/DeleteAnomalyDetectorCommand"; export * from "./commands/DeleteDashboardsCommand"; export * from "./commands/DeleteInsightRulesCommand"; export * from "./commands/DescribeAlarmHistoryCommand"; +export * from "./pagination/DescribeAlarmHistoryPaginator"; export * from "./commands/DescribeAlarmsCommand"; +export * from "./pagination/DescribeAlarmsPaginator"; export * from "./commands/DescribeAlarmsForMetricCommand"; export * from "./commands/DescribeAnomalyDetectorsCommand"; export * from "./commands/DescribeInsightRulesCommand"; +export * from "./pagination/DescribeInsightRulesPaginator"; export * from "./commands/DisableAlarmActionsCommand"; export * from "./commands/DisableInsightRulesCommand"; export * from "./commands/EnableAlarmActionsCommand"; @@ -16,10 +19,13 @@ export * from "./commands/EnableInsightRulesCommand"; export * from "./commands/GetDashboardCommand"; export * from "./commands/GetInsightRuleReportCommand"; export * from "./commands/GetMetricDataCommand"; +export * from "./pagination/GetMetricDataPaginator"; export * from "./commands/GetMetricStatisticsCommand"; export * from "./commands/GetMetricWidgetImageCommand"; export * from "./commands/ListDashboardsCommand"; +export * from "./pagination/ListDashboardsPaginator"; export * from "./commands/ListMetricsCommand"; +export * from "./pagination/ListMetricsPaginator"; export * from "./commands/ListTagsForResourceCommand"; export * from "./commands/PutAnomalyDetectorCommand"; export * from "./commands/PutCompositeAlarmCommand"; @@ -30,4 +36,5 @@ export * from "./commands/PutMetricDataCommand"; export * from "./commands/SetAlarmStateCommand"; export * from "./commands/TagResourceCommand"; export * from "./commands/UntagResourceCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-cloudwatch/pagination/DescribeAlarmHistoryPaginator.ts b/clients/client-cloudwatch/pagination/DescribeAlarmHistoryPaginator.ts new file mode 100644 index 0000000000000..7a2a138e077a7 --- /dev/null +++ b/clients/client-cloudwatch/pagination/DescribeAlarmHistoryPaginator.ts @@ -0,0 +1,51 @@ +import { CloudWatch } from "../CloudWatch"; +import { CloudWatchClient } from "../CloudWatchClient"; +import { + DescribeAlarmHistoryCommand, + DescribeAlarmHistoryCommandInput, + DescribeAlarmHistoryCommandOutput, +} from "../commands/DescribeAlarmHistoryCommand"; +import { CloudWatchPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudWatchClient, + input: DescribeAlarmHistoryCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeAlarmHistoryCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudWatch, + input: DescribeAlarmHistoryCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeAlarmHistory(input, ...args); +}; +export async function* describeAlarmHistoryPaginate( + config: CloudWatchPaginationConfiguration, + input: DescribeAlarmHistoryCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeAlarmHistoryCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof CloudWatch) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudWatchClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudWatch | CloudWatchClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-cloudwatch/pagination/DescribeAlarmsPaginator.ts b/clients/client-cloudwatch/pagination/DescribeAlarmsPaginator.ts new file mode 100644 index 0000000000000..ffcba513e5c04 --- /dev/null +++ b/clients/client-cloudwatch/pagination/DescribeAlarmsPaginator.ts @@ -0,0 +1,51 @@ +import { CloudWatch } from "../CloudWatch"; +import { CloudWatchClient } from "../CloudWatchClient"; +import { + DescribeAlarmsCommand, + DescribeAlarmsCommandInput, + DescribeAlarmsCommandOutput, +} from "../commands/DescribeAlarmsCommand"; +import { CloudWatchPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudWatchClient, + input: DescribeAlarmsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeAlarmsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudWatch, + input: DescribeAlarmsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeAlarms(input, ...args); +}; +export async function* describeAlarmsPaginate( + config: CloudWatchPaginationConfiguration, + input: DescribeAlarmsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeAlarmsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof CloudWatch) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudWatchClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudWatch | CloudWatchClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-cloudwatch/pagination/DescribeInsightRulesPaginator.ts b/clients/client-cloudwatch/pagination/DescribeInsightRulesPaginator.ts new file mode 100644 index 0000000000000..baf0d17977850 --- /dev/null +++ b/clients/client-cloudwatch/pagination/DescribeInsightRulesPaginator.ts @@ -0,0 +1,51 @@ +import { CloudWatch } from "../CloudWatch"; +import { CloudWatchClient } from "../CloudWatchClient"; +import { + DescribeInsightRulesCommand, + DescribeInsightRulesCommandInput, + DescribeInsightRulesCommandOutput, +} from "../commands/DescribeInsightRulesCommand"; +import { CloudWatchPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudWatchClient, + input: DescribeInsightRulesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeInsightRulesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudWatch, + input: DescribeInsightRulesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeInsightRules(input, ...args); +}; +export async function* describeInsightRulesPaginate( + config: CloudWatchPaginationConfiguration, + input: DescribeInsightRulesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeInsightRulesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof CloudWatch) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudWatchClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudWatch | CloudWatchClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-cloudwatch/pagination/GetMetricDataPaginator.ts b/clients/client-cloudwatch/pagination/GetMetricDataPaginator.ts new file mode 100644 index 0000000000000..35274bd0c243f --- /dev/null +++ b/clients/client-cloudwatch/pagination/GetMetricDataPaginator.ts @@ -0,0 +1,51 @@ +import { CloudWatch } from "../CloudWatch"; +import { CloudWatchClient } from "../CloudWatchClient"; +import { + GetMetricDataCommand, + GetMetricDataCommandInput, + GetMetricDataCommandOutput, +} from "../commands/GetMetricDataCommand"; +import { CloudWatchPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudWatchClient, + input: GetMetricDataCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetMetricDataCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudWatch, + input: GetMetricDataCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getMetricData(input, ...args); +}; +export async function* getMetricDataPaginate( + config: CloudWatchPaginationConfiguration, + input: GetMetricDataCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetMetricDataCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxDatapoints"] = config.pageSize; + if (config.client instanceof CloudWatch) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudWatchClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudWatch | CloudWatchClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-cloudwatch/pagination/Interfaces.ts b/clients/client-cloudwatch/pagination/Interfaces.ts new file mode 100644 index 0000000000000..f350fc910b784 --- /dev/null +++ b/clients/client-cloudwatch/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { CloudWatch } from "../CloudWatch"; +import { CloudWatchClient } from "../CloudWatchClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface CloudWatchPaginationConfiguration extends PaginationConfiguration { + client: CloudWatch | CloudWatchClient; +} diff --git a/clients/client-cloudwatch/pagination/ListDashboardsPaginator.ts b/clients/client-cloudwatch/pagination/ListDashboardsPaginator.ts new file mode 100644 index 0000000000000..a35cc5262d200 --- /dev/null +++ b/clients/client-cloudwatch/pagination/ListDashboardsPaginator.ts @@ -0,0 +1,50 @@ +import { CloudWatch } from "../CloudWatch"; +import { CloudWatchClient } from "../CloudWatchClient"; +import { + ListDashboardsCommand, + ListDashboardsCommandInput, + ListDashboardsCommandOutput, +} from "../commands/ListDashboardsCommand"; +import { CloudWatchPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudWatchClient, + input: ListDashboardsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDashboardsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudWatch, + input: ListDashboardsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDashboards(input, ...args); +}; +export async function* listDashboardsPaginate( + config: CloudWatchPaginationConfiguration, + input: ListDashboardsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDashboardsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + if (config.client instanceof CloudWatch) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudWatchClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudWatch | CloudWatchClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-cloudwatch/pagination/ListMetricsPaginator.ts b/clients/client-cloudwatch/pagination/ListMetricsPaginator.ts new file mode 100644 index 0000000000000..80b4fd311c5b7 --- /dev/null +++ b/clients/client-cloudwatch/pagination/ListMetricsPaginator.ts @@ -0,0 +1,46 @@ +import { CloudWatch } from "../CloudWatch"; +import { CloudWatchClient } from "../CloudWatchClient"; +import { ListMetricsCommand, ListMetricsCommandInput, ListMetricsCommandOutput } from "../commands/ListMetricsCommand"; +import { CloudWatchPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CloudWatchClient, + input: ListMetricsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListMetricsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CloudWatch, + input: ListMetricsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listMetrics(input, ...args); +}; +export async function* listMetricsPaginate( + config: CloudWatchPaginationConfiguration, + input: ListMetricsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListMetricsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + if (config.client instanceof CloudWatch) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CloudWatchClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CloudWatch | CloudWatchClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codeartifact/index.ts b/clients/client-codeartifact/index.ts index 5680d007bc096..2baf77a5b1da6 100644 --- a/clients/client-codeartifact/index.ts +++ b/clients/client-codeartifact/index.ts @@ -21,14 +21,21 @@ export * from "./commands/GetPackageVersionReadmeCommand"; export * from "./commands/GetRepositoryEndpointCommand"; export * from "./commands/GetRepositoryPermissionsPolicyCommand"; export * from "./commands/ListDomainsCommand"; +export * from "./pagination/ListDomainsPaginator"; export * from "./commands/ListPackagesCommand"; +export * from "./pagination/ListPackagesPaginator"; export * from "./commands/ListPackageVersionAssetsCommand"; +export * from "./pagination/ListPackageVersionAssetsPaginator"; export * from "./commands/ListPackageVersionDependenciesCommand"; export * from "./commands/ListPackageVersionsCommand"; +export * from "./pagination/ListPackageVersionsPaginator"; export * from "./commands/ListRepositoriesCommand"; +export * from "./pagination/ListRepositoriesPaginator"; export * from "./commands/ListRepositoriesInDomainCommand"; +export * from "./pagination/ListRepositoriesInDomainPaginator"; export * from "./commands/PutDomainPermissionsPolicyCommand"; export * from "./commands/PutRepositoryPermissionsPolicyCommand"; export * from "./commands/UpdatePackageVersionsStatusCommand"; export * from "./commands/UpdateRepositoryCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-codeartifact/pagination/Interfaces.ts b/clients/client-codeartifact/pagination/Interfaces.ts new file mode 100644 index 0000000000000..45bde5660fb85 --- /dev/null +++ b/clients/client-codeartifact/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { Codeartifact } from "../Codeartifact"; +import { CodeartifactClient } from "../CodeartifactClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface CodeartifactPaginationConfiguration extends PaginationConfiguration { + client: Codeartifact | CodeartifactClient; +} diff --git a/clients/client-codeartifact/pagination/ListDomainsPaginator.ts b/clients/client-codeartifact/pagination/ListDomainsPaginator.ts new file mode 100644 index 0000000000000..f2c2b993e4b7d --- /dev/null +++ b/clients/client-codeartifact/pagination/ListDomainsPaginator.ts @@ -0,0 +1,47 @@ +import { Codeartifact } from "../Codeartifact"; +import { CodeartifactClient } from "../CodeartifactClient"; +import { ListDomainsCommand, ListDomainsCommandInput, ListDomainsCommandOutput } from "../commands/ListDomainsCommand"; +import { CodeartifactPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodeartifactClient, + input: ListDomainsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDomainsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Codeartifact, + input: ListDomainsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDomains(input, ...args); +}; +export async function* listDomainsPaginate( + config: CodeartifactPaginationConfiguration, + input: ListDomainsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDomainsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof Codeartifact) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodeartifactClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Codeartifact | CodeartifactClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codeartifact/pagination/ListPackageVersionAssetsPaginator.ts b/clients/client-codeartifact/pagination/ListPackageVersionAssetsPaginator.ts new file mode 100644 index 0000000000000..d561d9dccd27a --- /dev/null +++ b/clients/client-codeartifact/pagination/ListPackageVersionAssetsPaginator.ts @@ -0,0 +1,51 @@ +import { Codeartifact } from "../Codeartifact"; +import { CodeartifactClient } from "../CodeartifactClient"; +import { + ListPackageVersionAssetsCommand, + ListPackageVersionAssetsCommandInput, + ListPackageVersionAssetsCommandOutput, +} from "../commands/ListPackageVersionAssetsCommand"; +import { CodeartifactPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodeartifactClient, + input: ListPackageVersionAssetsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListPackageVersionAssetsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Codeartifact, + input: ListPackageVersionAssetsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listPackageVersionAssets(input, ...args); +}; +export async function* listPackageVersionAssetsPaginate( + config: CodeartifactPaginationConfiguration, + input: ListPackageVersionAssetsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListPackageVersionAssetsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof Codeartifact) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodeartifactClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Codeartifact | CodeartifactClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codeartifact/pagination/ListPackageVersionsPaginator.ts b/clients/client-codeartifact/pagination/ListPackageVersionsPaginator.ts new file mode 100644 index 0000000000000..c219ccf39924e --- /dev/null +++ b/clients/client-codeartifact/pagination/ListPackageVersionsPaginator.ts @@ -0,0 +1,51 @@ +import { Codeartifact } from "../Codeartifact"; +import { CodeartifactClient } from "../CodeartifactClient"; +import { + ListPackageVersionsCommand, + ListPackageVersionsCommandInput, + ListPackageVersionsCommandOutput, +} from "../commands/ListPackageVersionsCommand"; +import { CodeartifactPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodeartifactClient, + input: ListPackageVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListPackageVersionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Codeartifact, + input: ListPackageVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listPackageVersions(input, ...args); +}; +export async function* listPackageVersionsPaginate( + config: CodeartifactPaginationConfiguration, + input: ListPackageVersionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListPackageVersionsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof Codeartifact) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodeartifactClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Codeartifact | CodeartifactClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codeartifact/pagination/ListPackagesPaginator.ts b/clients/client-codeartifact/pagination/ListPackagesPaginator.ts new file mode 100644 index 0000000000000..9f297226c73dd --- /dev/null +++ b/clients/client-codeartifact/pagination/ListPackagesPaginator.ts @@ -0,0 +1,51 @@ +import { Codeartifact } from "../Codeartifact"; +import { CodeartifactClient } from "../CodeartifactClient"; +import { + ListPackagesCommand, + ListPackagesCommandInput, + ListPackagesCommandOutput, +} from "../commands/ListPackagesCommand"; +import { CodeartifactPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodeartifactClient, + input: ListPackagesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListPackagesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Codeartifact, + input: ListPackagesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listPackages(input, ...args); +}; +export async function* listPackagesPaginate( + config: CodeartifactPaginationConfiguration, + input: ListPackagesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListPackagesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof Codeartifact) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodeartifactClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Codeartifact | CodeartifactClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codeartifact/pagination/ListRepositoriesInDomainPaginator.ts b/clients/client-codeartifact/pagination/ListRepositoriesInDomainPaginator.ts new file mode 100644 index 0000000000000..d2e1abde3ae88 --- /dev/null +++ b/clients/client-codeartifact/pagination/ListRepositoriesInDomainPaginator.ts @@ -0,0 +1,51 @@ +import { Codeartifact } from "../Codeartifact"; +import { CodeartifactClient } from "../CodeartifactClient"; +import { + ListRepositoriesInDomainCommand, + ListRepositoriesInDomainCommandInput, + ListRepositoriesInDomainCommandOutput, +} from "../commands/ListRepositoriesInDomainCommand"; +import { CodeartifactPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodeartifactClient, + input: ListRepositoriesInDomainCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListRepositoriesInDomainCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Codeartifact, + input: ListRepositoriesInDomainCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listRepositoriesInDomain(input, ...args); +}; +export async function* listRepositoriesInDomainPaginate( + config: CodeartifactPaginationConfiguration, + input: ListRepositoriesInDomainCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListRepositoriesInDomainCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof Codeartifact) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodeartifactClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Codeartifact | CodeartifactClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codeartifact/pagination/ListRepositoriesPaginator.ts b/clients/client-codeartifact/pagination/ListRepositoriesPaginator.ts new file mode 100644 index 0000000000000..447c2e6c4d04a --- /dev/null +++ b/clients/client-codeartifact/pagination/ListRepositoriesPaginator.ts @@ -0,0 +1,51 @@ +import { Codeartifact } from "../Codeartifact"; +import { CodeartifactClient } from "../CodeartifactClient"; +import { + ListRepositoriesCommand, + ListRepositoriesCommandInput, + ListRepositoriesCommandOutput, +} from "../commands/ListRepositoriesCommand"; +import { CodeartifactPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodeartifactClient, + input: ListRepositoriesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListRepositoriesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Codeartifact, + input: ListRepositoriesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listRepositories(input, ...args); +}; +export async function* listRepositoriesPaginate( + config: CodeartifactPaginationConfiguration, + input: ListRepositoriesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListRepositoriesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof Codeartifact) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodeartifactClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Codeartifact | CodeartifactClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codebuild/index.ts b/clients/client-codebuild/index.ts index 06655dbd51d0e..ba171629aac51 100644 --- a/clients/client-codebuild/index.ts +++ b/clients/client-codebuild/index.ts @@ -17,21 +17,33 @@ export * from "./commands/DeleteResourcePolicyCommand"; export * from "./commands/DeleteSourceCredentialsCommand"; export * from "./commands/DeleteWebhookCommand"; export * from "./commands/DescribeCodeCoveragesCommand"; +export * from "./pagination/DescribeCodeCoveragesPaginator"; export * from "./commands/DescribeTestCasesCommand"; +export * from "./pagination/DescribeTestCasesPaginator"; export * from "./commands/GetResourcePolicyCommand"; export * from "./commands/ImportSourceCredentialsCommand"; export * from "./commands/InvalidateProjectCacheCommand"; export * from "./commands/ListBuildBatchesCommand"; +export * from "./pagination/ListBuildBatchesPaginator"; export * from "./commands/ListBuildBatchesForProjectCommand"; +export * from "./pagination/ListBuildBatchesForProjectPaginator"; export * from "./commands/ListBuildsCommand"; +export * from "./pagination/ListBuildsPaginator"; export * from "./commands/ListBuildsForProjectCommand"; +export * from "./pagination/ListBuildsForProjectPaginator"; export * from "./commands/ListCuratedEnvironmentImagesCommand"; export * from "./commands/ListProjectsCommand"; +export * from "./pagination/ListProjectsPaginator"; export * from "./commands/ListReportGroupsCommand"; +export * from "./pagination/ListReportGroupsPaginator"; export * from "./commands/ListReportsCommand"; +export * from "./pagination/ListReportsPaginator"; export * from "./commands/ListReportsForReportGroupCommand"; +export * from "./pagination/ListReportsForReportGroupPaginator"; export * from "./commands/ListSharedProjectsCommand"; +export * from "./pagination/ListSharedProjectsPaginator"; export * from "./commands/ListSharedReportGroupsCommand"; +export * from "./pagination/ListSharedReportGroupsPaginator"; export * from "./commands/ListSourceCredentialsCommand"; export * from "./commands/PutResourcePolicyCommand"; export * from "./commands/RetryBuildCommand"; @@ -43,4 +55,5 @@ export * from "./commands/StopBuildBatchCommand"; export * from "./commands/UpdateProjectCommand"; export * from "./commands/UpdateReportGroupCommand"; export * from "./commands/UpdateWebhookCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-codebuild/pagination/DescribeCodeCoveragesPaginator.ts b/clients/client-codebuild/pagination/DescribeCodeCoveragesPaginator.ts new file mode 100644 index 0000000000000..93c244e254332 --- /dev/null +++ b/clients/client-codebuild/pagination/DescribeCodeCoveragesPaginator.ts @@ -0,0 +1,51 @@ +import { CodeBuild } from "../CodeBuild"; +import { CodeBuildClient } from "../CodeBuildClient"; +import { + DescribeCodeCoveragesCommand, + DescribeCodeCoveragesCommandInput, + DescribeCodeCoveragesCommandOutput, +} from "../commands/DescribeCodeCoveragesCommand"; +import { CodeBuildPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodeBuildClient, + input: DescribeCodeCoveragesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeCodeCoveragesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CodeBuild, + input: DescribeCodeCoveragesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeCodeCoverages(input, ...args); +}; +export async function* describeCodeCoveragesPaginate( + config: CodeBuildPaginationConfiguration, + input: DescribeCodeCoveragesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeCodeCoveragesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof CodeBuild) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodeBuildClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CodeBuild | CodeBuildClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codebuild/pagination/DescribeTestCasesPaginator.ts b/clients/client-codebuild/pagination/DescribeTestCasesPaginator.ts new file mode 100644 index 0000000000000..f337b5916cdda --- /dev/null +++ b/clients/client-codebuild/pagination/DescribeTestCasesPaginator.ts @@ -0,0 +1,51 @@ +import { CodeBuild } from "../CodeBuild"; +import { CodeBuildClient } from "../CodeBuildClient"; +import { + DescribeTestCasesCommand, + DescribeTestCasesCommandInput, + DescribeTestCasesCommandOutput, +} from "../commands/DescribeTestCasesCommand"; +import { CodeBuildPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodeBuildClient, + input: DescribeTestCasesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeTestCasesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CodeBuild, + input: DescribeTestCasesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeTestCases(input, ...args); +}; +export async function* describeTestCasesPaginate( + config: CodeBuildPaginationConfiguration, + input: DescribeTestCasesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeTestCasesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof CodeBuild) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodeBuildClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CodeBuild | CodeBuildClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codebuild/pagination/Interfaces.ts b/clients/client-codebuild/pagination/Interfaces.ts new file mode 100644 index 0000000000000..d383f09469a75 --- /dev/null +++ b/clients/client-codebuild/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { CodeBuild } from "../CodeBuild"; +import { CodeBuildClient } from "../CodeBuildClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface CodeBuildPaginationConfiguration extends PaginationConfiguration { + client: CodeBuild | CodeBuildClient; +} diff --git a/clients/client-codebuild/pagination/ListBuildBatchesForProjectPaginator.ts b/clients/client-codebuild/pagination/ListBuildBatchesForProjectPaginator.ts new file mode 100644 index 0000000000000..102f57b4a8951 --- /dev/null +++ b/clients/client-codebuild/pagination/ListBuildBatchesForProjectPaginator.ts @@ -0,0 +1,51 @@ +import { CodeBuild } from "../CodeBuild"; +import { CodeBuildClient } from "../CodeBuildClient"; +import { + ListBuildBatchesForProjectCommand, + ListBuildBatchesForProjectCommandInput, + ListBuildBatchesForProjectCommandOutput, +} from "../commands/ListBuildBatchesForProjectCommand"; +import { CodeBuildPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodeBuildClient, + input: ListBuildBatchesForProjectCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListBuildBatchesForProjectCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CodeBuild, + input: ListBuildBatchesForProjectCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listBuildBatchesForProject(input, ...args); +}; +export async function* listBuildBatchesForProjectPaginate( + config: CodeBuildPaginationConfiguration, + input: ListBuildBatchesForProjectCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListBuildBatchesForProjectCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof CodeBuild) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodeBuildClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CodeBuild | CodeBuildClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codebuild/pagination/ListBuildBatchesPaginator.ts b/clients/client-codebuild/pagination/ListBuildBatchesPaginator.ts new file mode 100644 index 0000000000000..c94620bedaef9 --- /dev/null +++ b/clients/client-codebuild/pagination/ListBuildBatchesPaginator.ts @@ -0,0 +1,51 @@ +import { CodeBuild } from "../CodeBuild"; +import { CodeBuildClient } from "../CodeBuildClient"; +import { + ListBuildBatchesCommand, + ListBuildBatchesCommandInput, + ListBuildBatchesCommandOutput, +} from "../commands/ListBuildBatchesCommand"; +import { CodeBuildPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodeBuildClient, + input: ListBuildBatchesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListBuildBatchesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CodeBuild, + input: ListBuildBatchesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listBuildBatches(input, ...args); +}; +export async function* listBuildBatchesPaginate( + config: CodeBuildPaginationConfiguration, + input: ListBuildBatchesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListBuildBatchesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof CodeBuild) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodeBuildClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CodeBuild | CodeBuildClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codebuild/pagination/ListBuildsForProjectPaginator.ts b/clients/client-codebuild/pagination/ListBuildsForProjectPaginator.ts new file mode 100644 index 0000000000000..ce43d0d401604 --- /dev/null +++ b/clients/client-codebuild/pagination/ListBuildsForProjectPaginator.ts @@ -0,0 +1,50 @@ +import { CodeBuild } from "../CodeBuild"; +import { CodeBuildClient } from "../CodeBuildClient"; +import { + ListBuildsForProjectCommand, + ListBuildsForProjectCommandInput, + ListBuildsForProjectCommandOutput, +} from "../commands/ListBuildsForProjectCommand"; +import { CodeBuildPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodeBuildClient, + input: ListBuildsForProjectCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListBuildsForProjectCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CodeBuild, + input: ListBuildsForProjectCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listBuildsForProject(input, ...args); +}; +export async function* listBuildsForProjectPaginate( + config: CodeBuildPaginationConfiguration, + input: ListBuildsForProjectCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListBuildsForProjectCommandOutput; + while (hasNext) { + input["nextToken"] = token; + if (config.client instanceof CodeBuild) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodeBuildClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CodeBuild | CodeBuildClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codebuild/pagination/ListBuildsPaginator.ts b/clients/client-codebuild/pagination/ListBuildsPaginator.ts new file mode 100644 index 0000000000000..1f507cbfcd879 --- /dev/null +++ b/clients/client-codebuild/pagination/ListBuildsPaginator.ts @@ -0,0 +1,46 @@ +import { CodeBuild } from "../CodeBuild"; +import { CodeBuildClient } from "../CodeBuildClient"; +import { ListBuildsCommand, ListBuildsCommandInput, ListBuildsCommandOutput } from "../commands/ListBuildsCommand"; +import { CodeBuildPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodeBuildClient, + input: ListBuildsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListBuildsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CodeBuild, + input: ListBuildsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listBuilds(input, ...args); +}; +export async function* listBuildsPaginate( + config: CodeBuildPaginationConfiguration, + input: ListBuildsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListBuildsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + if (config.client instanceof CodeBuild) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodeBuildClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CodeBuild | CodeBuildClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codebuild/pagination/ListProjectsPaginator.ts b/clients/client-codebuild/pagination/ListProjectsPaginator.ts new file mode 100644 index 0000000000000..4823fbcd024c0 --- /dev/null +++ b/clients/client-codebuild/pagination/ListProjectsPaginator.ts @@ -0,0 +1,50 @@ +import { CodeBuild } from "../CodeBuild"; +import { CodeBuildClient } from "../CodeBuildClient"; +import { + ListProjectsCommand, + ListProjectsCommandInput, + ListProjectsCommandOutput, +} from "../commands/ListProjectsCommand"; +import { CodeBuildPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodeBuildClient, + input: ListProjectsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListProjectsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CodeBuild, + input: ListProjectsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listProjects(input, ...args); +}; +export async function* listProjectsPaginate( + config: CodeBuildPaginationConfiguration, + input: ListProjectsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListProjectsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + if (config.client instanceof CodeBuild) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodeBuildClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CodeBuild | CodeBuildClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codebuild/pagination/ListReportGroupsPaginator.ts b/clients/client-codebuild/pagination/ListReportGroupsPaginator.ts new file mode 100644 index 0000000000000..35d16ca804cb0 --- /dev/null +++ b/clients/client-codebuild/pagination/ListReportGroupsPaginator.ts @@ -0,0 +1,51 @@ +import { CodeBuild } from "../CodeBuild"; +import { CodeBuildClient } from "../CodeBuildClient"; +import { + ListReportGroupsCommand, + ListReportGroupsCommandInput, + ListReportGroupsCommandOutput, +} from "../commands/ListReportGroupsCommand"; +import { CodeBuildPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodeBuildClient, + input: ListReportGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListReportGroupsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CodeBuild, + input: ListReportGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listReportGroups(input, ...args); +}; +export async function* listReportGroupsPaginate( + config: CodeBuildPaginationConfiguration, + input: ListReportGroupsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListReportGroupsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof CodeBuild) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodeBuildClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CodeBuild | CodeBuildClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codebuild/pagination/ListReportsForReportGroupPaginator.ts b/clients/client-codebuild/pagination/ListReportsForReportGroupPaginator.ts new file mode 100644 index 0000000000000..623306ce19e22 --- /dev/null +++ b/clients/client-codebuild/pagination/ListReportsForReportGroupPaginator.ts @@ -0,0 +1,51 @@ +import { CodeBuild } from "../CodeBuild"; +import { CodeBuildClient } from "../CodeBuildClient"; +import { + ListReportsForReportGroupCommand, + ListReportsForReportGroupCommandInput, + ListReportsForReportGroupCommandOutput, +} from "../commands/ListReportsForReportGroupCommand"; +import { CodeBuildPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodeBuildClient, + input: ListReportsForReportGroupCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListReportsForReportGroupCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CodeBuild, + input: ListReportsForReportGroupCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listReportsForReportGroup(input, ...args); +}; +export async function* listReportsForReportGroupPaginate( + config: CodeBuildPaginationConfiguration, + input: ListReportsForReportGroupCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListReportsForReportGroupCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof CodeBuild) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodeBuildClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CodeBuild | CodeBuildClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codebuild/pagination/ListReportsPaginator.ts b/clients/client-codebuild/pagination/ListReportsPaginator.ts new file mode 100644 index 0000000000000..9557822c7c7b3 --- /dev/null +++ b/clients/client-codebuild/pagination/ListReportsPaginator.ts @@ -0,0 +1,47 @@ +import { CodeBuild } from "../CodeBuild"; +import { CodeBuildClient } from "../CodeBuildClient"; +import { ListReportsCommand, ListReportsCommandInput, ListReportsCommandOutput } from "../commands/ListReportsCommand"; +import { CodeBuildPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodeBuildClient, + input: ListReportsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListReportsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CodeBuild, + input: ListReportsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listReports(input, ...args); +}; +export async function* listReportsPaginate( + config: CodeBuildPaginationConfiguration, + input: ListReportsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListReportsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof CodeBuild) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodeBuildClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CodeBuild | CodeBuildClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codebuild/pagination/ListSharedProjectsPaginator.ts b/clients/client-codebuild/pagination/ListSharedProjectsPaginator.ts new file mode 100644 index 0000000000000..296581ba63124 --- /dev/null +++ b/clients/client-codebuild/pagination/ListSharedProjectsPaginator.ts @@ -0,0 +1,51 @@ +import { CodeBuild } from "../CodeBuild"; +import { CodeBuildClient } from "../CodeBuildClient"; +import { + ListSharedProjectsCommand, + ListSharedProjectsCommandInput, + ListSharedProjectsCommandOutput, +} from "../commands/ListSharedProjectsCommand"; +import { CodeBuildPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodeBuildClient, + input: ListSharedProjectsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListSharedProjectsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CodeBuild, + input: ListSharedProjectsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listSharedProjects(input, ...args); +}; +export async function* listSharedProjectsPaginate( + config: CodeBuildPaginationConfiguration, + input: ListSharedProjectsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListSharedProjectsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof CodeBuild) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodeBuildClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CodeBuild | CodeBuildClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codebuild/pagination/ListSharedReportGroupsPaginator.ts b/clients/client-codebuild/pagination/ListSharedReportGroupsPaginator.ts new file mode 100644 index 0000000000000..eaf16721b718a --- /dev/null +++ b/clients/client-codebuild/pagination/ListSharedReportGroupsPaginator.ts @@ -0,0 +1,51 @@ +import { CodeBuild } from "../CodeBuild"; +import { CodeBuildClient } from "../CodeBuildClient"; +import { + ListSharedReportGroupsCommand, + ListSharedReportGroupsCommandInput, + ListSharedReportGroupsCommandOutput, +} from "../commands/ListSharedReportGroupsCommand"; +import { CodeBuildPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodeBuildClient, + input: ListSharedReportGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListSharedReportGroupsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CodeBuild, + input: ListSharedReportGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listSharedReportGroups(input, ...args); +}; +export async function* listSharedReportGroupsPaginate( + config: CodeBuildPaginationConfiguration, + input: ListSharedReportGroupsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListSharedReportGroupsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof CodeBuild) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodeBuildClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CodeBuild | CodeBuildClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codecommit/index.ts b/clients/client-codecommit/index.ts index 2ccbdd049e12d..6af3e2662333b 100644 --- a/clients/client-codecommit/index.ts +++ b/clients/client-codecommit/index.ts @@ -20,7 +20,9 @@ export * from "./commands/DeleteFileCommand"; export * from "./commands/DeletePullRequestApprovalRuleCommand"; export * from "./commands/DeleteRepositoryCommand"; export * from "./commands/DescribeMergeConflictsCommand"; +export * from "./pagination/DescribeMergeConflictsPaginator"; export * from "./commands/DescribePullRequestEventsCommand"; +export * from "./pagination/DescribePullRequestEventsPaginator"; export * from "./commands/DisassociateApprovalRuleTemplateFromRepositoryCommand"; export * from "./commands/EvaluatePullRequestApprovalRulesCommand"; export * from "./commands/GetApprovalRuleTemplateCommand"; @@ -28,14 +30,19 @@ export * from "./commands/GetBlobCommand"; export * from "./commands/GetBranchCommand"; export * from "./commands/GetCommentCommand"; export * from "./commands/GetCommentReactionsCommand"; +export * from "./pagination/GetCommentReactionsPaginator"; export * from "./commands/GetCommentsForComparedCommitCommand"; +export * from "./pagination/GetCommentsForComparedCommitPaginator"; export * from "./commands/GetCommentsForPullRequestCommand"; +export * from "./pagination/GetCommentsForPullRequestPaginator"; export * from "./commands/GetCommitCommand"; export * from "./commands/GetDifferencesCommand"; +export * from "./pagination/GetDifferencesPaginator"; export * from "./commands/GetFileCommand"; export * from "./commands/GetFolderCommand"; export * from "./commands/GetMergeCommitCommand"; export * from "./commands/GetMergeConflictsCommand"; +export * from "./pagination/GetMergeConflictsPaginator"; export * from "./commands/GetMergeOptionsCommand"; export * from "./commands/GetPullRequestCommand"; export * from "./commands/GetPullRequestApprovalStatesCommand"; @@ -43,11 +50,17 @@ export * from "./commands/GetPullRequestOverrideStateCommand"; export * from "./commands/GetRepositoryCommand"; export * from "./commands/GetRepositoryTriggersCommand"; export * from "./commands/ListApprovalRuleTemplatesCommand"; +export * from "./pagination/ListApprovalRuleTemplatesPaginator"; export * from "./commands/ListAssociatedApprovalRuleTemplatesForRepositoryCommand"; +export * from "./pagination/ListAssociatedApprovalRuleTemplatesForRepositoryPaginator"; export * from "./commands/ListBranchesCommand"; +export * from "./pagination/ListBranchesPaginator"; export * from "./commands/ListPullRequestsCommand"; +export * from "./pagination/ListPullRequestsPaginator"; export * from "./commands/ListRepositoriesCommand"; +export * from "./pagination/ListRepositoriesPaginator"; export * from "./commands/ListRepositoriesForApprovalRuleTemplateCommand"; +export * from "./pagination/ListRepositoriesForApprovalRuleTemplatePaginator"; export * from "./commands/ListTagsForResourceCommand"; export * from "./commands/MergeBranchesByFastForwardCommand"; export * from "./commands/MergeBranchesBySquashCommand"; @@ -77,4 +90,5 @@ export * from "./commands/UpdatePullRequestStatusCommand"; export * from "./commands/UpdatePullRequestTitleCommand"; export * from "./commands/UpdateRepositoryDescriptionCommand"; export * from "./commands/UpdateRepositoryNameCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-codecommit/pagination/DescribeMergeConflictsPaginator.ts b/clients/client-codecommit/pagination/DescribeMergeConflictsPaginator.ts new file mode 100644 index 0000000000000..f263b1ff12dd4 --- /dev/null +++ b/clients/client-codecommit/pagination/DescribeMergeConflictsPaginator.ts @@ -0,0 +1,51 @@ +import { CodeCommit } from "../CodeCommit"; +import { CodeCommitClient } from "../CodeCommitClient"; +import { + DescribeMergeConflictsCommand, + DescribeMergeConflictsCommandInput, + DescribeMergeConflictsCommandOutput, +} from "../commands/DescribeMergeConflictsCommand"; +import { CodeCommitPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodeCommitClient, + input: DescribeMergeConflictsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeMergeConflictsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CodeCommit, + input: DescribeMergeConflictsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeMergeConflicts(input, ...args); +}; +export async function* describeMergeConflictsPaginate( + config: CodeCommitPaginationConfiguration, + input: DescribeMergeConflictsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeMergeConflictsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxMergeHunks"] = config.pageSize; + if (config.client instanceof CodeCommit) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodeCommitClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CodeCommit | CodeCommitClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codecommit/pagination/DescribePullRequestEventsPaginator.ts b/clients/client-codecommit/pagination/DescribePullRequestEventsPaginator.ts new file mode 100644 index 0000000000000..1f4b2346de9de --- /dev/null +++ b/clients/client-codecommit/pagination/DescribePullRequestEventsPaginator.ts @@ -0,0 +1,51 @@ +import { CodeCommit } from "../CodeCommit"; +import { CodeCommitClient } from "../CodeCommitClient"; +import { + DescribePullRequestEventsCommand, + DescribePullRequestEventsCommandInput, + DescribePullRequestEventsCommandOutput, +} from "../commands/DescribePullRequestEventsCommand"; +import { CodeCommitPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodeCommitClient, + input: DescribePullRequestEventsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribePullRequestEventsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CodeCommit, + input: DescribePullRequestEventsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describePullRequestEvents(input, ...args); +}; +export async function* describePullRequestEventsPaginate( + config: CodeCommitPaginationConfiguration, + input: DescribePullRequestEventsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribePullRequestEventsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof CodeCommit) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodeCommitClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CodeCommit | CodeCommitClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codecommit/pagination/GetCommentReactionsPaginator.ts b/clients/client-codecommit/pagination/GetCommentReactionsPaginator.ts new file mode 100644 index 0000000000000..25cf1d2fbdde6 --- /dev/null +++ b/clients/client-codecommit/pagination/GetCommentReactionsPaginator.ts @@ -0,0 +1,51 @@ +import { CodeCommit } from "../CodeCommit"; +import { CodeCommitClient } from "../CodeCommitClient"; +import { + GetCommentReactionsCommand, + GetCommentReactionsCommandInput, + GetCommentReactionsCommandOutput, +} from "../commands/GetCommentReactionsCommand"; +import { CodeCommitPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodeCommitClient, + input: GetCommentReactionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetCommentReactionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CodeCommit, + input: GetCommentReactionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getCommentReactions(input, ...args); +}; +export async function* getCommentReactionsPaginate( + config: CodeCommitPaginationConfiguration, + input: GetCommentReactionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetCommentReactionsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof CodeCommit) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodeCommitClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CodeCommit | CodeCommitClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codecommit/pagination/GetCommentsForComparedCommitPaginator.ts b/clients/client-codecommit/pagination/GetCommentsForComparedCommitPaginator.ts new file mode 100644 index 0000000000000..f56115240a4ca --- /dev/null +++ b/clients/client-codecommit/pagination/GetCommentsForComparedCommitPaginator.ts @@ -0,0 +1,51 @@ +import { CodeCommit } from "../CodeCommit"; +import { CodeCommitClient } from "../CodeCommitClient"; +import { + GetCommentsForComparedCommitCommand, + GetCommentsForComparedCommitCommandInput, + GetCommentsForComparedCommitCommandOutput, +} from "../commands/GetCommentsForComparedCommitCommand"; +import { CodeCommitPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodeCommitClient, + input: GetCommentsForComparedCommitCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetCommentsForComparedCommitCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CodeCommit, + input: GetCommentsForComparedCommitCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getCommentsForComparedCommit(input, ...args); +}; +export async function* getCommentsForComparedCommitPaginate( + config: CodeCommitPaginationConfiguration, + input: GetCommentsForComparedCommitCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetCommentsForComparedCommitCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof CodeCommit) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodeCommitClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CodeCommit | CodeCommitClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codecommit/pagination/GetCommentsForPullRequestPaginator.ts b/clients/client-codecommit/pagination/GetCommentsForPullRequestPaginator.ts new file mode 100644 index 0000000000000..3044fe1660608 --- /dev/null +++ b/clients/client-codecommit/pagination/GetCommentsForPullRequestPaginator.ts @@ -0,0 +1,51 @@ +import { CodeCommit } from "../CodeCommit"; +import { CodeCommitClient } from "../CodeCommitClient"; +import { + GetCommentsForPullRequestCommand, + GetCommentsForPullRequestCommandInput, + GetCommentsForPullRequestCommandOutput, +} from "../commands/GetCommentsForPullRequestCommand"; +import { CodeCommitPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodeCommitClient, + input: GetCommentsForPullRequestCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetCommentsForPullRequestCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CodeCommit, + input: GetCommentsForPullRequestCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getCommentsForPullRequest(input, ...args); +}; +export async function* getCommentsForPullRequestPaginate( + config: CodeCommitPaginationConfiguration, + input: GetCommentsForPullRequestCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetCommentsForPullRequestCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof CodeCommit) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodeCommitClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CodeCommit | CodeCommitClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codecommit/pagination/GetDifferencesPaginator.ts b/clients/client-codecommit/pagination/GetDifferencesPaginator.ts new file mode 100644 index 0000000000000..fcae4a3837a46 --- /dev/null +++ b/clients/client-codecommit/pagination/GetDifferencesPaginator.ts @@ -0,0 +1,51 @@ +import { CodeCommit } from "../CodeCommit"; +import { CodeCommitClient } from "../CodeCommitClient"; +import { + GetDifferencesCommand, + GetDifferencesCommandInput, + GetDifferencesCommandOutput, +} from "../commands/GetDifferencesCommand"; +import { CodeCommitPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodeCommitClient, + input: GetDifferencesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetDifferencesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CodeCommit, + input: GetDifferencesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getDifferences(input, ...args); +}; +export async function* getDifferencesPaginate( + config: CodeCommitPaginationConfiguration, + input: GetDifferencesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetDifferencesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof CodeCommit) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodeCommitClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CodeCommit | CodeCommitClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codecommit/pagination/GetMergeConflictsPaginator.ts b/clients/client-codecommit/pagination/GetMergeConflictsPaginator.ts new file mode 100644 index 0000000000000..b308fc5890816 --- /dev/null +++ b/clients/client-codecommit/pagination/GetMergeConflictsPaginator.ts @@ -0,0 +1,51 @@ +import { CodeCommit } from "../CodeCommit"; +import { CodeCommitClient } from "../CodeCommitClient"; +import { + GetMergeConflictsCommand, + GetMergeConflictsCommandInput, + GetMergeConflictsCommandOutput, +} from "../commands/GetMergeConflictsCommand"; +import { CodeCommitPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodeCommitClient, + input: GetMergeConflictsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetMergeConflictsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CodeCommit, + input: GetMergeConflictsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getMergeConflicts(input, ...args); +}; +export async function* getMergeConflictsPaginate( + config: CodeCommitPaginationConfiguration, + input: GetMergeConflictsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetMergeConflictsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxConflictFiles"] = config.pageSize; + if (config.client instanceof CodeCommit) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodeCommitClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CodeCommit | CodeCommitClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codecommit/pagination/Interfaces.ts b/clients/client-codecommit/pagination/Interfaces.ts new file mode 100644 index 0000000000000..29955fdcabb0d --- /dev/null +++ b/clients/client-codecommit/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { CodeCommit } from "../CodeCommit"; +import { CodeCommitClient } from "../CodeCommitClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface CodeCommitPaginationConfiguration extends PaginationConfiguration { + client: CodeCommit | CodeCommitClient; +} diff --git a/clients/client-codecommit/pagination/ListApprovalRuleTemplatesPaginator.ts b/clients/client-codecommit/pagination/ListApprovalRuleTemplatesPaginator.ts new file mode 100644 index 0000000000000..c359bcbce32d4 --- /dev/null +++ b/clients/client-codecommit/pagination/ListApprovalRuleTemplatesPaginator.ts @@ -0,0 +1,51 @@ +import { CodeCommit } from "../CodeCommit"; +import { CodeCommitClient } from "../CodeCommitClient"; +import { + ListApprovalRuleTemplatesCommand, + ListApprovalRuleTemplatesCommandInput, + ListApprovalRuleTemplatesCommandOutput, +} from "../commands/ListApprovalRuleTemplatesCommand"; +import { CodeCommitPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodeCommitClient, + input: ListApprovalRuleTemplatesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListApprovalRuleTemplatesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CodeCommit, + input: ListApprovalRuleTemplatesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listApprovalRuleTemplates(input, ...args); +}; +export async function* listApprovalRuleTemplatesPaginate( + config: CodeCommitPaginationConfiguration, + input: ListApprovalRuleTemplatesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListApprovalRuleTemplatesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof CodeCommit) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodeCommitClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CodeCommit | CodeCommitClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codecommit/pagination/ListAssociatedApprovalRuleTemplatesForRepositoryPaginator.ts b/clients/client-codecommit/pagination/ListAssociatedApprovalRuleTemplatesForRepositoryPaginator.ts new file mode 100644 index 0000000000000..3f846ea46d77a --- /dev/null +++ b/clients/client-codecommit/pagination/ListAssociatedApprovalRuleTemplatesForRepositoryPaginator.ts @@ -0,0 +1,51 @@ +import { CodeCommit } from "../CodeCommit"; +import { CodeCommitClient } from "../CodeCommitClient"; +import { + ListAssociatedApprovalRuleTemplatesForRepositoryCommand, + ListAssociatedApprovalRuleTemplatesForRepositoryCommandInput, + ListAssociatedApprovalRuleTemplatesForRepositoryCommandOutput, +} from "../commands/ListAssociatedApprovalRuleTemplatesForRepositoryCommand"; +import { CodeCommitPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodeCommitClient, + input: ListAssociatedApprovalRuleTemplatesForRepositoryCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListAssociatedApprovalRuleTemplatesForRepositoryCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CodeCommit, + input: ListAssociatedApprovalRuleTemplatesForRepositoryCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listAssociatedApprovalRuleTemplatesForRepository(input, ...args); +}; +export async function* listAssociatedApprovalRuleTemplatesForRepositoryPaginate( + config: CodeCommitPaginationConfiguration, + input: ListAssociatedApprovalRuleTemplatesForRepositoryCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListAssociatedApprovalRuleTemplatesForRepositoryCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof CodeCommit) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodeCommitClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CodeCommit | CodeCommitClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codecommit/pagination/ListBranchesPaginator.ts b/clients/client-codecommit/pagination/ListBranchesPaginator.ts new file mode 100644 index 0000000000000..9974198c88129 --- /dev/null +++ b/clients/client-codecommit/pagination/ListBranchesPaginator.ts @@ -0,0 +1,50 @@ +import { CodeCommit } from "../CodeCommit"; +import { CodeCommitClient } from "../CodeCommitClient"; +import { + ListBranchesCommand, + ListBranchesCommandInput, + ListBranchesCommandOutput, +} from "../commands/ListBranchesCommand"; +import { CodeCommitPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodeCommitClient, + input: ListBranchesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListBranchesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CodeCommit, + input: ListBranchesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listBranches(input, ...args); +}; +export async function* listBranchesPaginate( + config: CodeCommitPaginationConfiguration, + input: ListBranchesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListBranchesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + if (config.client instanceof CodeCommit) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodeCommitClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CodeCommit | CodeCommitClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codecommit/pagination/ListPullRequestsPaginator.ts b/clients/client-codecommit/pagination/ListPullRequestsPaginator.ts new file mode 100644 index 0000000000000..04b37f373db74 --- /dev/null +++ b/clients/client-codecommit/pagination/ListPullRequestsPaginator.ts @@ -0,0 +1,51 @@ +import { CodeCommit } from "../CodeCommit"; +import { CodeCommitClient } from "../CodeCommitClient"; +import { + ListPullRequestsCommand, + ListPullRequestsCommandInput, + ListPullRequestsCommandOutput, +} from "../commands/ListPullRequestsCommand"; +import { CodeCommitPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodeCommitClient, + input: ListPullRequestsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListPullRequestsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CodeCommit, + input: ListPullRequestsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listPullRequests(input, ...args); +}; +export async function* listPullRequestsPaginate( + config: CodeCommitPaginationConfiguration, + input: ListPullRequestsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListPullRequestsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof CodeCommit) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodeCommitClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CodeCommit | CodeCommitClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codecommit/pagination/ListRepositoriesForApprovalRuleTemplatePaginator.ts b/clients/client-codecommit/pagination/ListRepositoriesForApprovalRuleTemplatePaginator.ts new file mode 100644 index 0000000000000..e1464a4255a35 --- /dev/null +++ b/clients/client-codecommit/pagination/ListRepositoriesForApprovalRuleTemplatePaginator.ts @@ -0,0 +1,51 @@ +import { CodeCommit } from "../CodeCommit"; +import { CodeCommitClient } from "../CodeCommitClient"; +import { + ListRepositoriesForApprovalRuleTemplateCommand, + ListRepositoriesForApprovalRuleTemplateCommandInput, + ListRepositoriesForApprovalRuleTemplateCommandOutput, +} from "../commands/ListRepositoriesForApprovalRuleTemplateCommand"; +import { CodeCommitPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodeCommitClient, + input: ListRepositoriesForApprovalRuleTemplateCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListRepositoriesForApprovalRuleTemplateCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CodeCommit, + input: ListRepositoriesForApprovalRuleTemplateCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listRepositoriesForApprovalRuleTemplate(input, ...args); +}; +export async function* listRepositoriesForApprovalRuleTemplatePaginate( + config: CodeCommitPaginationConfiguration, + input: ListRepositoriesForApprovalRuleTemplateCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListRepositoriesForApprovalRuleTemplateCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof CodeCommit) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodeCommitClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CodeCommit | CodeCommitClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codecommit/pagination/ListRepositoriesPaginator.ts b/clients/client-codecommit/pagination/ListRepositoriesPaginator.ts new file mode 100644 index 0000000000000..6cba4181d03cf --- /dev/null +++ b/clients/client-codecommit/pagination/ListRepositoriesPaginator.ts @@ -0,0 +1,50 @@ +import { CodeCommit } from "../CodeCommit"; +import { CodeCommitClient } from "../CodeCommitClient"; +import { + ListRepositoriesCommand, + ListRepositoriesCommandInput, + ListRepositoriesCommandOutput, +} from "../commands/ListRepositoriesCommand"; +import { CodeCommitPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodeCommitClient, + input: ListRepositoriesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListRepositoriesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CodeCommit, + input: ListRepositoriesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listRepositories(input, ...args); +}; +export async function* listRepositoriesPaginate( + config: CodeCommitPaginationConfiguration, + input: ListRepositoriesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListRepositoriesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + if (config.client instanceof CodeCommit) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodeCommitClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CodeCommit | CodeCommitClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codedeploy/index.ts b/clients/client-codedeploy/index.ts index bf1f7da028aea..2e0ae7c4cc1b9 100644 --- a/clients/client-codedeploy/index.ts +++ b/clients/client-codedeploy/index.ts @@ -28,11 +28,17 @@ export * from "./commands/GetDeploymentInstanceCommand"; export * from "./commands/GetDeploymentTargetCommand"; export * from "./commands/GetOnPremisesInstanceCommand"; export * from "./commands/ListApplicationRevisionsCommand"; +export * from "./pagination/ListApplicationRevisionsPaginator"; export * from "./commands/ListApplicationsCommand"; +export * from "./pagination/ListApplicationsPaginator"; export * from "./commands/ListDeploymentConfigsCommand"; +export * from "./pagination/ListDeploymentConfigsPaginator"; export * from "./commands/ListDeploymentGroupsCommand"; +export * from "./pagination/ListDeploymentGroupsPaginator"; export * from "./commands/ListDeploymentInstancesCommand"; +export * from "./pagination/ListDeploymentInstancesPaginator"; export * from "./commands/ListDeploymentsCommand"; +export * from "./pagination/ListDeploymentsPaginator"; export * from "./commands/ListDeploymentTargetsCommand"; export * from "./commands/ListGitHubAccountTokenNamesCommand"; export * from "./commands/ListOnPremisesInstancesCommand"; @@ -47,4 +53,5 @@ export * from "./commands/TagResourceCommand"; export * from "./commands/UntagResourceCommand"; export * from "./commands/UpdateApplicationCommand"; export * from "./commands/UpdateDeploymentGroupCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-codedeploy/pagination/Interfaces.ts b/clients/client-codedeploy/pagination/Interfaces.ts new file mode 100644 index 0000000000000..3d8036e72e285 --- /dev/null +++ b/clients/client-codedeploy/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { CodeDeploy } from "../CodeDeploy"; +import { CodeDeployClient } from "../CodeDeployClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface CodeDeployPaginationConfiguration extends PaginationConfiguration { + client: CodeDeploy | CodeDeployClient; +} diff --git a/clients/client-codedeploy/pagination/ListApplicationRevisionsPaginator.ts b/clients/client-codedeploy/pagination/ListApplicationRevisionsPaginator.ts new file mode 100644 index 0000000000000..f83be91dcb00b --- /dev/null +++ b/clients/client-codedeploy/pagination/ListApplicationRevisionsPaginator.ts @@ -0,0 +1,50 @@ +import { CodeDeploy } from "../CodeDeploy"; +import { CodeDeployClient } from "../CodeDeployClient"; +import { + ListApplicationRevisionsCommand, + ListApplicationRevisionsCommandInput, + ListApplicationRevisionsCommandOutput, +} from "../commands/ListApplicationRevisionsCommand"; +import { CodeDeployPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodeDeployClient, + input: ListApplicationRevisionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListApplicationRevisionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CodeDeploy, + input: ListApplicationRevisionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listApplicationRevisions(input, ...args); +}; +export async function* listApplicationRevisionsPaginate( + config: CodeDeployPaginationConfiguration, + input: ListApplicationRevisionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListApplicationRevisionsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + if (config.client instanceof CodeDeploy) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodeDeployClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CodeDeploy | CodeDeployClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codedeploy/pagination/ListApplicationsPaginator.ts b/clients/client-codedeploy/pagination/ListApplicationsPaginator.ts new file mode 100644 index 0000000000000..8d4a336a89e22 --- /dev/null +++ b/clients/client-codedeploy/pagination/ListApplicationsPaginator.ts @@ -0,0 +1,50 @@ +import { CodeDeploy } from "../CodeDeploy"; +import { CodeDeployClient } from "../CodeDeployClient"; +import { + ListApplicationsCommand, + ListApplicationsCommandInput, + ListApplicationsCommandOutput, +} from "../commands/ListApplicationsCommand"; +import { CodeDeployPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodeDeployClient, + input: ListApplicationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListApplicationsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CodeDeploy, + input: ListApplicationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listApplications(input, ...args); +}; +export async function* listApplicationsPaginate( + config: CodeDeployPaginationConfiguration, + input: ListApplicationsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListApplicationsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + if (config.client instanceof CodeDeploy) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodeDeployClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CodeDeploy | CodeDeployClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codedeploy/pagination/ListDeploymentConfigsPaginator.ts b/clients/client-codedeploy/pagination/ListDeploymentConfigsPaginator.ts new file mode 100644 index 0000000000000..961d0216c2424 --- /dev/null +++ b/clients/client-codedeploy/pagination/ListDeploymentConfigsPaginator.ts @@ -0,0 +1,50 @@ +import { CodeDeploy } from "../CodeDeploy"; +import { CodeDeployClient } from "../CodeDeployClient"; +import { + ListDeploymentConfigsCommand, + ListDeploymentConfigsCommandInput, + ListDeploymentConfigsCommandOutput, +} from "../commands/ListDeploymentConfigsCommand"; +import { CodeDeployPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodeDeployClient, + input: ListDeploymentConfigsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDeploymentConfigsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CodeDeploy, + input: ListDeploymentConfigsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDeploymentConfigs(input, ...args); +}; +export async function* listDeploymentConfigsPaginate( + config: CodeDeployPaginationConfiguration, + input: ListDeploymentConfigsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDeploymentConfigsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + if (config.client instanceof CodeDeploy) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodeDeployClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CodeDeploy | CodeDeployClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codedeploy/pagination/ListDeploymentGroupsPaginator.ts b/clients/client-codedeploy/pagination/ListDeploymentGroupsPaginator.ts new file mode 100644 index 0000000000000..3126ad53d2d5c --- /dev/null +++ b/clients/client-codedeploy/pagination/ListDeploymentGroupsPaginator.ts @@ -0,0 +1,50 @@ +import { CodeDeploy } from "../CodeDeploy"; +import { CodeDeployClient } from "../CodeDeployClient"; +import { + ListDeploymentGroupsCommand, + ListDeploymentGroupsCommandInput, + ListDeploymentGroupsCommandOutput, +} from "../commands/ListDeploymentGroupsCommand"; +import { CodeDeployPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodeDeployClient, + input: ListDeploymentGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDeploymentGroupsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CodeDeploy, + input: ListDeploymentGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDeploymentGroups(input, ...args); +}; +export async function* listDeploymentGroupsPaginate( + config: CodeDeployPaginationConfiguration, + input: ListDeploymentGroupsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDeploymentGroupsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + if (config.client instanceof CodeDeploy) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodeDeployClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CodeDeploy | CodeDeployClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codedeploy/pagination/ListDeploymentInstancesPaginator.ts b/clients/client-codedeploy/pagination/ListDeploymentInstancesPaginator.ts new file mode 100644 index 0000000000000..07d509994a76e --- /dev/null +++ b/clients/client-codedeploy/pagination/ListDeploymentInstancesPaginator.ts @@ -0,0 +1,50 @@ +import { CodeDeploy } from "../CodeDeploy"; +import { CodeDeployClient } from "../CodeDeployClient"; +import { + ListDeploymentInstancesCommand, + ListDeploymentInstancesCommandInput, + ListDeploymentInstancesCommandOutput, +} from "../commands/ListDeploymentInstancesCommand"; +import { CodeDeployPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodeDeployClient, + input: ListDeploymentInstancesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDeploymentInstancesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CodeDeploy, + input: ListDeploymentInstancesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDeploymentInstances(input, ...args); +}; +export async function* listDeploymentInstancesPaginate( + config: CodeDeployPaginationConfiguration, + input: ListDeploymentInstancesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDeploymentInstancesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + if (config.client instanceof CodeDeploy) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodeDeployClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CodeDeploy | CodeDeployClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codedeploy/pagination/ListDeploymentsPaginator.ts b/clients/client-codedeploy/pagination/ListDeploymentsPaginator.ts new file mode 100644 index 0000000000000..e382fd3833506 --- /dev/null +++ b/clients/client-codedeploy/pagination/ListDeploymentsPaginator.ts @@ -0,0 +1,50 @@ +import { CodeDeploy } from "../CodeDeploy"; +import { CodeDeployClient } from "../CodeDeployClient"; +import { + ListDeploymentsCommand, + ListDeploymentsCommandInput, + ListDeploymentsCommandOutput, +} from "../commands/ListDeploymentsCommand"; +import { CodeDeployPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodeDeployClient, + input: ListDeploymentsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDeploymentsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CodeDeploy, + input: ListDeploymentsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDeployments(input, ...args); +}; +export async function* listDeploymentsPaginate( + config: CodeDeployPaginationConfiguration, + input: ListDeploymentsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDeploymentsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + if (config.client instanceof CodeDeploy) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodeDeployClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CodeDeploy | CodeDeployClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codeguru-reviewer/index.ts b/clients/client-codeguru-reviewer/index.ts index 7a8422a4d2ace..69c9071459db3 100644 --- a/clients/client-codeguru-reviewer/index.ts +++ b/clients/client-codeguru-reviewer/index.ts @@ -6,8 +6,13 @@ export * from "./commands/DescribeRecommendationFeedbackCommand"; export * from "./commands/DescribeRepositoryAssociationCommand"; export * from "./commands/DisassociateRepositoryCommand"; export * from "./commands/ListCodeReviewsCommand"; +export * from "./pagination/ListCodeReviewsPaginator"; export * from "./commands/ListRecommendationFeedbackCommand"; +export * from "./pagination/ListRecommendationFeedbackPaginator"; export * from "./commands/ListRecommendationsCommand"; +export * from "./pagination/ListRecommendationsPaginator"; export * from "./commands/ListRepositoryAssociationsCommand"; +export * from "./pagination/ListRepositoryAssociationsPaginator"; export * from "./commands/PutRecommendationFeedbackCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-codeguru-reviewer/pagination/Interfaces.ts b/clients/client-codeguru-reviewer/pagination/Interfaces.ts new file mode 100644 index 0000000000000..21b9fc29360a6 --- /dev/null +++ b/clients/client-codeguru-reviewer/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { CodeGuruReviewer } from "../CodeGuruReviewer"; +import { CodeGuruReviewerClient } from "../CodeGuruReviewerClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface CodeGuruReviewerPaginationConfiguration extends PaginationConfiguration { + client: CodeGuruReviewer | CodeGuruReviewerClient; +} diff --git a/clients/client-codeguru-reviewer/pagination/ListCodeReviewsPaginator.ts b/clients/client-codeguru-reviewer/pagination/ListCodeReviewsPaginator.ts new file mode 100644 index 0000000000000..2fe0d7a2cab25 --- /dev/null +++ b/clients/client-codeguru-reviewer/pagination/ListCodeReviewsPaginator.ts @@ -0,0 +1,51 @@ +import { CodeGuruReviewer } from "../CodeGuruReviewer"; +import { CodeGuruReviewerClient } from "../CodeGuruReviewerClient"; +import { + ListCodeReviewsCommand, + ListCodeReviewsCommandInput, + ListCodeReviewsCommandOutput, +} from "../commands/ListCodeReviewsCommand"; +import { CodeGuruReviewerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodeGuruReviewerClient, + input: ListCodeReviewsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListCodeReviewsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CodeGuruReviewer, + input: ListCodeReviewsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listCodeReviews(input, ...args); +}; +export async function* listCodeReviewsPaginate( + config: CodeGuruReviewerPaginationConfiguration, + input: ListCodeReviewsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListCodeReviewsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof CodeGuruReviewer) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodeGuruReviewerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CodeGuruReviewer | CodeGuruReviewerClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codeguru-reviewer/pagination/ListRecommendationFeedbackPaginator.ts b/clients/client-codeguru-reviewer/pagination/ListRecommendationFeedbackPaginator.ts new file mode 100644 index 0000000000000..cb42398902cec --- /dev/null +++ b/clients/client-codeguru-reviewer/pagination/ListRecommendationFeedbackPaginator.ts @@ -0,0 +1,51 @@ +import { CodeGuruReviewer } from "../CodeGuruReviewer"; +import { CodeGuruReviewerClient } from "../CodeGuruReviewerClient"; +import { + ListRecommendationFeedbackCommand, + ListRecommendationFeedbackCommandInput, + ListRecommendationFeedbackCommandOutput, +} from "../commands/ListRecommendationFeedbackCommand"; +import { CodeGuruReviewerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodeGuruReviewerClient, + input: ListRecommendationFeedbackCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListRecommendationFeedbackCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CodeGuruReviewer, + input: ListRecommendationFeedbackCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listRecommendationFeedback(input, ...args); +}; +export async function* listRecommendationFeedbackPaginate( + config: CodeGuruReviewerPaginationConfiguration, + input: ListRecommendationFeedbackCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListRecommendationFeedbackCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof CodeGuruReviewer) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodeGuruReviewerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CodeGuruReviewer | CodeGuruReviewerClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codeguru-reviewer/pagination/ListRecommendationsPaginator.ts b/clients/client-codeguru-reviewer/pagination/ListRecommendationsPaginator.ts new file mode 100644 index 0000000000000..38d200b061414 --- /dev/null +++ b/clients/client-codeguru-reviewer/pagination/ListRecommendationsPaginator.ts @@ -0,0 +1,51 @@ +import { CodeGuruReviewer } from "../CodeGuruReviewer"; +import { CodeGuruReviewerClient } from "../CodeGuruReviewerClient"; +import { + ListRecommendationsCommand, + ListRecommendationsCommandInput, + ListRecommendationsCommandOutput, +} from "../commands/ListRecommendationsCommand"; +import { CodeGuruReviewerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodeGuruReviewerClient, + input: ListRecommendationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListRecommendationsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CodeGuruReviewer, + input: ListRecommendationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listRecommendations(input, ...args); +}; +export async function* listRecommendationsPaginate( + config: CodeGuruReviewerPaginationConfiguration, + input: ListRecommendationsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListRecommendationsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof CodeGuruReviewer) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodeGuruReviewerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CodeGuruReviewer | CodeGuruReviewerClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codeguru-reviewer/pagination/ListRepositoryAssociationsPaginator.ts b/clients/client-codeguru-reviewer/pagination/ListRepositoryAssociationsPaginator.ts new file mode 100644 index 0000000000000..77e10af3c2582 --- /dev/null +++ b/clients/client-codeguru-reviewer/pagination/ListRepositoryAssociationsPaginator.ts @@ -0,0 +1,51 @@ +import { CodeGuruReviewer } from "../CodeGuruReviewer"; +import { CodeGuruReviewerClient } from "../CodeGuruReviewerClient"; +import { + ListRepositoryAssociationsCommand, + ListRepositoryAssociationsCommandInput, + ListRepositoryAssociationsCommandOutput, +} from "../commands/ListRepositoryAssociationsCommand"; +import { CodeGuruReviewerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodeGuruReviewerClient, + input: ListRepositoryAssociationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListRepositoryAssociationsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CodeGuruReviewer, + input: ListRepositoryAssociationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listRepositoryAssociations(input, ...args); +}; +export async function* listRepositoryAssociationsPaginate( + config: CodeGuruReviewerPaginationConfiguration, + input: ListRepositoryAssociationsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListRepositoryAssociationsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof CodeGuruReviewer) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodeGuruReviewerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CodeGuruReviewer | CodeGuruReviewerClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codeguruprofiler/index.ts b/clients/client-codeguruprofiler/index.ts index 78a9a9a1583f9..4a7dbf0ca2132 100644 --- a/clients/client-codeguruprofiler/index.ts +++ b/clients/client-codeguruprofiler/index.ts @@ -5,12 +5,15 @@ export * from "./commands/CreateProfilingGroupCommand"; export * from "./commands/DeleteProfilingGroupCommand"; export * from "./commands/DescribeProfilingGroupCommand"; export * from "./commands/ListProfilingGroupsCommand"; +export * from "./pagination/ListProfilingGroupsPaginator"; export * from "./commands/UpdateProfilingGroupCommand"; export * from "./commands/GetPolicyCommand"; export * from "./commands/PutPermissionCommand"; export * from "./commands/RemovePermissionCommand"; export * from "./commands/GetProfileCommand"; export * from "./commands/ListProfileTimesCommand"; +export * from "./pagination/ListProfileTimesPaginator"; export * from "./commands/PostAgentProfileCommand"; export * from "./commands/RetrieveTimeSeriesCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-codeguruprofiler/pagination/Interfaces.ts b/clients/client-codeguruprofiler/pagination/Interfaces.ts new file mode 100644 index 0000000000000..d96e556949408 --- /dev/null +++ b/clients/client-codeguruprofiler/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { CodeGuruProfiler } from "../CodeGuruProfiler"; +import { CodeGuruProfilerClient } from "../CodeGuruProfilerClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface CodeGuruProfilerPaginationConfiguration extends PaginationConfiguration { + client: CodeGuruProfiler | CodeGuruProfilerClient; +} diff --git a/clients/client-codeguruprofiler/pagination/ListProfileTimesPaginator.ts b/clients/client-codeguruprofiler/pagination/ListProfileTimesPaginator.ts new file mode 100644 index 0000000000000..a804437e7ab80 --- /dev/null +++ b/clients/client-codeguruprofiler/pagination/ListProfileTimesPaginator.ts @@ -0,0 +1,51 @@ +import { CodeGuruProfiler } from "../CodeGuruProfiler"; +import { CodeGuruProfilerClient } from "../CodeGuruProfilerClient"; +import { + ListProfileTimesCommand, + ListProfileTimesCommandInput, + ListProfileTimesCommandOutput, +} from "../commands/ListProfileTimesCommand"; +import { CodeGuruProfilerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodeGuruProfilerClient, + input: ListProfileTimesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListProfileTimesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CodeGuruProfiler, + input: ListProfileTimesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listProfileTimes(input, ...args); +}; +export async function* listProfileTimesPaginate( + config: CodeGuruProfilerPaginationConfiguration, + input: ListProfileTimesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListProfileTimesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof CodeGuruProfiler) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodeGuruProfilerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CodeGuruProfiler | CodeGuruProfilerClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codeguruprofiler/pagination/ListProfilingGroupsPaginator.ts b/clients/client-codeguruprofiler/pagination/ListProfilingGroupsPaginator.ts new file mode 100644 index 0000000000000..552869a2b58a5 --- /dev/null +++ b/clients/client-codeguruprofiler/pagination/ListProfilingGroupsPaginator.ts @@ -0,0 +1,51 @@ +import { CodeGuruProfiler } from "../CodeGuruProfiler"; +import { CodeGuruProfilerClient } from "../CodeGuruProfilerClient"; +import { + ListProfilingGroupsCommand, + ListProfilingGroupsCommandInput, + ListProfilingGroupsCommandOutput, +} from "../commands/ListProfilingGroupsCommand"; +import { CodeGuruProfilerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodeGuruProfilerClient, + input: ListProfilingGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListProfilingGroupsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CodeGuruProfiler, + input: ListProfilingGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listProfilingGroups(input, ...args); +}; +export async function* listProfilingGroupsPaginate( + config: CodeGuruProfilerPaginationConfiguration, + input: ListProfilingGroupsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListProfilingGroupsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof CodeGuruProfiler) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodeGuruProfilerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CodeGuruProfiler | CodeGuruProfilerClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codepipeline/index.ts b/clients/client-codepipeline/index.ts index c71cca4dffd58..ac9fb15b51ab8 100644 --- a/clients/client-codepipeline/index.ts +++ b/clients/client-codepipeline/index.ts @@ -16,11 +16,17 @@ export * from "./commands/GetPipelineExecutionCommand"; export * from "./commands/GetPipelineStateCommand"; export * from "./commands/GetThirdPartyJobDetailsCommand"; export * from "./commands/ListActionExecutionsCommand"; +export * from "./pagination/ListActionExecutionsPaginator"; export * from "./commands/ListActionTypesCommand"; +export * from "./pagination/ListActionTypesPaginator"; export * from "./commands/ListPipelineExecutionsCommand"; +export * from "./pagination/ListPipelineExecutionsPaginator"; export * from "./commands/ListPipelinesCommand"; +export * from "./pagination/ListPipelinesPaginator"; export * from "./commands/ListTagsForResourceCommand"; +export * from "./pagination/ListTagsForResourcePaginator"; export * from "./commands/ListWebhooksCommand"; +export * from "./pagination/ListWebhooksPaginator"; export * from "./commands/PollForJobsCommand"; export * from "./commands/PollForThirdPartyJobsCommand"; export * from "./commands/PutActionRevisionCommand"; @@ -37,4 +43,5 @@ export * from "./commands/StopPipelineExecutionCommand"; export * from "./commands/TagResourceCommand"; export * from "./commands/UntagResourceCommand"; export * from "./commands/UpdatePipelineCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-codepipeline/pagination/Interfaces.ts b/clients/client-codepipeline/pagination/Interfaces.ts new file mode 100644 index 0000000000000..7387e9aa58f96 --- /dev/null +++ b/clients/client-codepipeline/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { CodePipeline } from "../CodePipeline"; +import { CodePipelineClient } from "../CodePipelineClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface CodePipelinePaginationConfiguration extends PaginationConfiguration { + client: CodePipeline | CodePipelineClient; +} diff --git a/clients/client-codepipeline/pagination/ListActionExecutionsPaginator.ts b/clients/client-codepipeline/pagination/ListActionExecutionsPaginator.ts new file mode 100644 index 0000000000000..1c61ec08ccc8e --- /dev/null +++ b/clients/client-codepipeline/pagination/ListActionExecutionsPaginator.ts @@ -0,0 +1,51 @@ +import { CodePipeline } from "../CodePipeline"; +import { CodePipelineClient } from "../CodePipelineClient"; +import { + ListActionExecutionsCommand, + ListActionExecutionsCommandInput, + ListActionExecutionsCommandOutput, +} from "../commands/ListActionExecutionsCommand"; +import { CodePipelinePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodePipelineClient, + input: ListActionExecutionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListActionExecutionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CodePipeline, + input: ListActionExecutionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listActionExecutions(input, ...args); +}; +export async function* listActionExecutionsPaginate( + config: CodePipelinePaginationConfiguration, + input: ListActionExecutionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListActionExecutionsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof CodePipeline) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodePipelineClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CodePipeline | CodePipelineClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codepipeline/pagination/ListActionTypesPaginator.ts b/clients/client-codepipeline/pagination/ListActionTypesPaginator.ts new file mode 100644 index 0000000000000..a6a1827fbf302 --- /dev/null +++ b/clients/client-codepipeline/pagination/ListActionTypesPaginator.ts @@ -0,0 +1,50 @@ +import { CodePipeline } from "../CodePipeline"; +import { CodePipelineClient } from "../CodePipelineClient"; +import { + ListActionTypesCommand, + ListActionTypesCommandInput, + ListActionTypesCommandOutput, +} from "../commands/ListActionTypesCommand"; +import { CodePipelinePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodePipelineClient, + input: ListActionTypesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListActionTypesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CodePipeline, + input: ListActionTypesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listActionTypes(input, ...args); +}; +export async function* listActionTypesPaginate( + config: CodePipelinePaginationConfiguration, + input: ListActionTypesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListActionTypesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + if (config.client instanceof CodePipeline) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodePipelineClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CodePipeline | CodePipelineClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codepipeline/pagination/ListPipelineExecutionsPaginator.ts b/clients/client-codepipeline/pagination/ListPipelineExecutionsPaginator.ts new file mode 100644 index 0000000000000..483f90e951cc8 --- /dev/null +++ b/clients/client-codepipeline/pagination/ListPipelineExecutionsPaginator.ts @@ -0,0 +1,51 @@ +import { CodePipeline } from "../CodePipeline"; +import { CodePipelineClient } from "../CodePipelineClient"; +import { + ListPipelineExecutionsCommand, + ListPipelineExecutionsCommandInput, + ListPipelineExecutionsCommandOutput, +} from "../commands/ListPipelineExecutionsCommand"; +import { CodePipelinePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodePipelineClient, + input: ListPipelineExecutionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListPipelineExecutionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CodePipeline, + input: ListPipelineExecutionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listPipelineExecutions(input, ...args); +}; +export async function* listPipelineExecutionsPaginate( + config: CodePipelinePaginationConfiguration, + input: ListPipelineExecutionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListPipelineExecutionsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof CodePipeline) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodePipelineClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CodePipeline | CodePipelineClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codepipeline/pagination/ListPipelinesPaginator.ts b/clients/client-codepipeline/pagination/ListPipelinesPaginator.ts new file mode 100644 index 0000000000000..2d654c5a59990 --- /dev/null +++ b/clients/client-codepipeline/pagination/ListPipelinesPaginator.ts @@ -0,0 +1,50 @@ +import { CodePipeline } from "../CodePipeline"; +import { CodePipelineClient } from "../CodePipelineClient"; +import { + ListPipelinesCommand, + ListPipelinesCommandInput, + ListPipelinesCommandOutput, +} from "../commands/ListPipelinesCommand"; +import { CodePipelinePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodePipelineClient, + input: ListPipelinesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListPipelinesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CodePipeline, + input: ListPipelinesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listPipelines(input, ...args); +}; +export async function* listPipelinesPaginate( + config: CodePipelinePaginationConfiguration, + input: ListPipelinesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListPipelinesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + if (config.client instanceof CodePipeline) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodePipelineClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CodePipeline | CodePipelineClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codepipeline/pagination/ListTagsForResourcePaginator.ts b/clients/client-codepipeline/pagination/ListTagsForResourcePaginator.ts new file mode 100644 index 0000000000000..78af22c9ad08b --- /dev/null +++ b/clients/client-codepipeline/pagination/ListTagsForResourcePaginator.ts @@ -0,0 +1,51 @@ +import { CodePipeline } from "../CodePipeline"; +import { CodePipelineClient } from "../CodePipelineClient"; +import { + ListTagsForResourceCommand, + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput, +} from "../commands/ListTagsForResourceCommand"; +import { CodePipelinePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodePipelineClient, + input: ListTagsForResourceCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTagsForResourceCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CodePipeline, + input: ListTagsForResourceCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTagsForResource(input, ...args); +}; +export async function* listTagsForResourcePaginate( + config: CodePipelinePaginationConfiguration, + input: ListTagsForResourceCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTagsForResourceCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof CodePipeline) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodePipelineClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CodePipeline | CodePipelineClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codepipeline/pagination/ListWebhooksPaginator.ts b/clients/client-codepipeline/pagination/ListWebhooksPaginator.ts new file mode 100644 index 0000000000000..670c1241ca07b --- /dev/null +++ b/clients/client-codepipeline/pagination/ListWebhooksPaginator.ts @@ -0,0 +1,51 @@ +import { CodePipeline } from "../CodePipeline"; +import { CodePipelineClient } from "../CodePipelineClient"; +import { + ListWebhooksCommand, + ListWebhooksCommandInput, + ListWebhooksCommandOutput, +} from "../commands/ListWebhooksCommand"; +import { CodePipelinePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodePipelineClient, + input: ListWebhooksCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListWebhooksCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CodePipeline, + input: ListWebhooksCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listWebhooks(input, ...args); +}; +export async function* listWebhooksPaginate( + config: CodePipelinePaginationConfiguration, + input: ListWebhooksCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListWebhooksCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof CodePipeline) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodePipelineClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CodePipeline | CodePipelineClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codestar-connections/index.ts b/clients/client-codestar-connections/index.ts index b04e7f71ec3a6..46604f7a3ff61 100644 --- a/clients/client-codestar-connections/index.ts +++ b/clients/client-codestar-connections/index.ts @@ -7,8 +7,11 @@ export * from "./commands/DeleteHostCommand"; export * from "./commands/GetConnectionCommand"; export * from "./commands/GetHostCommand"; export * from "./commands/ListConnectionsCommand"; +export * from "./pagination/ListConnectionsPaginator"; export * from "./commands/ListHostsCommand"; +export * from "./pagination/ListHostsPaginator"; export * from "./commands/ListTagsForResourceCommand"; export * from "./commands/TagResourceCommand"; export * from "./commands/UntagResourceCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-codestar-connections/pagination/Interfaces.ts b/clients/client-codestar-connections/pagination/Interfaces.ts new file mode 100644 index 0000000000000..776114934a315 --- /dev/null +++ b/clients/client-codestar-connections/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { CodeStarConnections } from "../CodeStarConnections"; +import { CodeStarConnectionsClient } from "../CodeStarConnectionsClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface CodeStarConnectionsPaginationConfiguration extends PaginationConfiguration { + client: CodeStarConnections | CodeStarConnectionsClient; +} diff --git a/clients/client-codestar-connections/pagination/ListConnectionsPaginator.ts b/clients/client-codestar-connections/pagination/ListConnectionsPaginator.ts new file mode 100644 index 0000000000000..024cd55b5fef6 --- /dev/null +++ b/clients/client-codestar-connections/pagination/ListConnectionsPaginator.ts @@ -0,0 +1,51 @@ +import { CodeStarConnections } from "../CodeStarConnections"; +import { CodeStarConnectionsClient } from "../CodeStarConnectionsClient"; +import { + ListConnectionsCommand, + ListConnectionsCommandInput, + ListConnectionsCommandOutput, +} from "../commands/ListConnectionsCommand"; +import { CodeStarConnectionsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodeStarConnectionsClient, + input: ListConnectionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListConnectionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CodeStarConnections, + input: ListConnectionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listConnections(input, ...args); +}; +export async function* listConnectionsPaginate( + config: CodeStarConnectionsPaginationConfiguration, + input: ListConnectionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListConnectionsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof CodeStarConnections) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodeStarConnectionsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CodeStarConnections | CodeStarConnectionsClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codestar-connections/pagination/ListHostsPaginator.ts b/clients/client-codestar-connections/pagination/ListHostsPaginator.ts new file mode 100644 index 0000000000000..3ba131574691b --- /dev/null +++ b/clients/client-codestar-connections/pagination/ListHostsPaginator.ts @@ -0,0 +1,47 @@ +import { CodeStarConnections } from "../CodeStarConnections"; +import { CodeStarConnectionsClient } from "../CodeStarConnectionsClient"; +import { ListHostsCommand, ListHostsCommandInput, ListHostsCommandOutput } from "../commands/ListHostsCommand"; +import { CodeStarConnectionsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodeStarConnectionsClient, + input: ListHostsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListHostsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CodeStarConnections, + input: ListHostsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listHosts(input, ...args); +}; +export async function* listHostsPaginate( + config: CodeStarConnectionsPaginationConfiguration, + input: ListHostsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListHostsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof CodeStarConnections) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodeStarConnectionsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CodeStarConnections | CodeStarConnectionsClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codestar-notifications/index.ts b/clients/client-codestar-notifications/index.ts index 61b6e6303c88b..38aa42a2ee1f8 100644 --- a/clients/client-codestar-notifications/index.ts +++ b/clients/client-codestar-notifications/index.ts @@ -5,12 +5,16 @@ export * from "./commands/DeleteNotificationRuleCommand"; export * from "./commands/DeleteTargetCommand"; export * from "./commands/DescribeNotificationRuleCommand"; export * from "./commands/ListEventTypesCommand"; +export * from "./pagination/ListEventTypesPaginator"; export * from "./commands/ListNotificationRulesCommand"; +export * from "./pagination/ListNotificationRulesPaginator"; export * from "./commands/ListTagsForResourceCommand"; export * from "./commands/ListTargetsCommand"; +export * from "./pagination/ListTargetsPaginator"; export * from "./commands/SubscribeCommand"; export * from "./commands/TagResourceCommand"; export * from "./commands/UnsubscribeCommand"; export * from "./commands/UntagResourceCommand"; export * from "./commands/UpdateNotificationRuleCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-codestar-notifications/pagination/Interfaces.ts b/clients/client-codestar-notifications/pagination/Interfaces.ts new file mode 100644 index 0000000000000..d2fbd4c9ef308 --- /dev/null +++ b/clients/client-codestar-notifications/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { CodestarNotifications } from "../CodestarNotifications"; +import { CodestarNotificationsClient } from "../CodestarNotificationsClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface CodestarNotificationsPaginationConfiguration extends PaginationConfiguration { + client: CodestarNotifications | CodestarNotificationsClient; +} diff --git a/clients/client-codestar-notifications/pagination/ListEventTypesPaginator.ts b/clients/client-codestar-notifications/pagination/ListEventTypesPaginator.ts new file mode 100644 index 0000000000000..85ce0e8f3f98d --- /dev/null +++ b/clients/client-codestar-notifications/pagination/ListEventTypesPaginator.ts @@ -0,0 +1,51 @@ +import { CodestarNotifications } from "../CodestarNotifications"; +import { CodestarNotificationsClient } from "../CodestarNotificationsClient"; +import { + ListEventTypesCommand, + ListEventTypesCommandInput, + ListEventTypesCommandOutput, +} from "../commands/ListEventTypesCommand"; +import { CodestarNotificationsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodestarNotificationsClient, + input: ListEventTypesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListEventTypesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CodestarNotifications, + input: ListEventTypesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listEventTypes(input, ...args); +}; +export async function* listEventTypesPaginate( + config: CodestarNotificationsPaginationConfiguration, + input: ListEventTypesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListEventTypesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof CodestarNotifications) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodestarNotificationsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CodestarNotifications | CodestarNotificationsClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codestar-notifications/pagination/ListNotificationRulesPaginator.ts b/clients/client-codestar-notifications/pagination/ListNotificationRulesPaginator.ts new file mode 100644 index 0000000000000..a52f40e6f826b --- /dev/null +++ b/clients/client-codestar-notifications/pagination/ListNotificationRulesPaginator.ts @@ -0,0 +1,51 @@ +import { CodestarNotifications } from "../CodestarNotifications"; +import { CodestarNotificationsClient } from "../CodestarNotificationsClient"; +import { + ListNotificationRulesCommand, + ListNotificationRulesCommandInput, + ListNotificationRulesCommandOutput, +} from "../commands/ListNotificationRulesCommand"; +import { CodestarNotificationsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodestarNotificationsClient, + input: ListNotificationRulesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListNotificationRulesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CodestarNotifications, + input: ListNotificationRulesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listNotificationRules(input, ...args); +}; +export async function* listNotificationRulesPaginate( + config: CodestarNotificationsPaginationConfiguration, + input: ListNotificationRulesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListNotificationRulesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof CodestarNotifications) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodestarNotificationsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CodestarNotifications | CodestarNotificationsClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-codestar-notifications/pagination/ListTargetsPaginator.ts b/clients/client-codestar-notifications/pagination/ListTargetsPaginator.ts new file mode 100644 index 0000000000000..cf8acdebabe0f --- /dev/null +++ b/clients/client-codestar-notifications/pagination/ListTargetsPaginator.ts @@ -0,0 +1,47 @@ +import { CodestarNotifications } from "../CodestarNotifications"; +import { CodestarNotificationsClient } from "../CodestarNotificationsClient"; +import { ListTargetsCommand, ListTargetsCommandInput, ListTargetsCommandOutput } from "../commands/ListTargetsCommand"; +import { CodestarNotificationsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CodestarNotificationsClient, + input: ListTargetsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTargetsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CodestarNotifications, + input: ListTargetsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTargets(input, ...args); +}; +export async function* listTargetsPaginate( + config: CodestarNotificationsPaginationConfiguration, + input: ListTargetsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTargetsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof CodestarNotifications) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CodestarNotificationsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CodestarNotifications | CodestarNotificationsClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-cognito-identity-provider/index.ts b/clients/client-cognito-identity-provider/index.ts index a2ad10bee2c2b..44f2f7f5ca031 100644 --- a/clients/client-cognito-identity-provider/index.ts +++ b/clients/client-cognito-identity-provider/index.ts @@ -16,7 +16,9 @@ export * from "./commands/AdminInitiateAuthCommand"; export * from "./commands/AdminLinkProviderForUserCommand"; export * from "./commands/AdminListDevicesCommand"; export * from "./commands/AdminListGroupsForUserCommand"; +export * from "./pagination/AdminListGroupsForUserPaginator"; export * from "./commands/AdminListUserAuthEventsCommand"; +export * from "./pagination/AdminListUserAuthEventsPaginator"; export * from "./commands/AdminRemoveUserFromGroupCommand"; export * from "./commands/AdminResetUserPasswordCommand"; export * from "./commands/AdminRespondToAuthChallengeCommand"; @@ -69,14 +71,20 @@ export * from "./commands/GlobalSignOutCommand"; export * from "./commands/InitiateAuthCommand"; export * from "./commands/ListDevicesCommand"; export * from "./commands/ListGroupsCommand"; +export * from "./pagination/ListGroupsPaginator"; export * from "./commands/ListIdentityProvidersCommand"; +export * from "./pagination/ListIdentityProvidersPaginator"; export * from "./commands/ListResourceServersCommand"; +export * from "./pagination/ListResourceServersPaginator"; export * from "./commands/ListTagsForResourceCommand"; export * from "./commands/ListUserImportJobsCommand"; export * from "./commands/ListUserPoolClientsCommand"; +export * from "./pagination/ListUserPoolClientsPaginator"; export * from "./commands/ListUserPoolsCommand"; export * from "./commands/ListUsersCommand"; +export * from "./pagination/ListUsersPaginator"; export * from "./commands/ListUsersInGroupCommand"; +export * from "./pagination/ListUsersInGroupPaginator"; export * from "./commands/ResendConfirmationCodeCommand"; export * from "./commands/RespondToAuthChallengeCommand"; export * from "./commands/SetRiskConfigurationCommand"; @@ -100,4 +108,5 @@ export * from "./commands/UpdateUserPoolClientCommand"; export * from "./commands/UpdateUserPoolDomainCommand"; export * from "./commands/VerifySoftwareTokenCommand"; export * from "./commands/VerifyUserAttributeCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-cognito-identity-provider/pagination/AdminListGroupsForUserPaginator.ts b/clients/client-cognito-identity-provider/pagination/AdminListGroupsForUserPaginator.ts new file mode 100644 index 0000000000000..7304817f5e144 --- /dev/null +++ b/clients/client-cognito-identity-provider/pagination/AdminListGroupsForUserPaginator.ts @@ -0,0 +1,51 @@ +import { CognitoIdentityProvider } from "../CognitoIdentityProvider"; +import { CognitoIdentityProviderClient } from "../CognitoIdentityProviderClient"; +import { + AdminListGroupsForUserCommand, + AdminListGroupsForUserCommandInput, + AdminListGroupsForUserCommandOutput, +} from "../commands/AdminListGroupsForUserCommand"; +import { CognitoIdentityProviderPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CognitoIdentityProviderClient, + input: AdminListGroupsForUserCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new AdminListGroupsForUserCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CognitoIdentityProvider, + input: AdminListGroupsForUserCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.adminListGroupsForUser(input, ...args); +}; +export async function* adminListGroupsForUserPaginate( + config: CognitoIdentityProviderPaginationConfiguration, + input: AdminListGroupsForUserCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: AdminListGroupsForUserCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["Limit"] = config.pageSize; + if (config.client instanceof CognitoIdentityProvider) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CognitoIdentityProviderClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CognitoIdentityProvider | CognitoIdentityProviderClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-cognito-identity-provider/pagination/AdminListUserAuthEventsPaginator.ts b/clients/client-cognito-identity-provider/pagination/AdminListUserAuthEventsPaginator.ts new file mode 100644 index 0000000000000..ba59a2711e538 --- /dev/null +++ b/clients/client-cognito-identity-provider/pagination/AdminListUserAuthEventsPaginator.ts @@ -0,0 +1,51 @@ +import { CognitoIdentityProvider } from "../CognitoIdentityProvider"; +import { CognitoIdentityProviderClient } from "../CognitoIdentityProviderClient"; +import { + AdminListUserAuthEventsCommand, + AdminListUserAuthEventsCommandInput, + AdminListUserAuthEventsCommandOutput, +} from "../commands/AdminListUserAuthEventsCommand"; +import { CognitoIdentityProviderPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CognitoIdentityProviderClient, + input: AdminListUserAuthEventsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new AdminListUserAuthEventsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CognitoIdentityProvider, + input: AdminListUserAuthEventsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.adminListUserAuthEvents(input, ...args); +}; +export async function* adminListUserAuthEventsPaginate( + config: CognitoIdentityProviderPaginationConfiguration, + input: AdminListUserAuthEventsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: AdminListUserAuthEventsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof CognitoIdentityProvider) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CognitoIdentityProviderClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CognitoIdentityProvider | CognitoIdentityProviderClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-cognito-identity-provider/pagination/Interfaces.ts b/clients/client-cognito-identity-provider/pagination/Interfaces.ts new file mode 100644 index 0000000000000..a4e12414f6e19 --- /dev/null +++ b/clients/client-cognito-identity-provider/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { CognitoIdentityProvider } from "../CognitoIdentityProvider"; +import { CognitoIdentityProviderClient } from "../CognitoIdentityProviderClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface CognitoIdentityProviderPaginationConfiguration extends PaginationConfiguration { + client: CognitoIdentityProvider | CognitoIdentityProviderClient; +} diff --git a/clients/client-cognito-identity-provider/pagination/ListGroupsPaginator.ts b/clients/client-cognito-identity-provider/pagination/ListGroupsPaginator.ts new file mode 100644 index 0000000000000..4c2dab67b1e07 --- /dev/null +++ b/clients/client-cognito-identity-provider/pagination/ListGroupsPaginator.ts @@ -0,0 +1,47 @@ +import { CognitoIdentityProvider } from "../CognitoIdentityProvider"; +import { CognitoIdentityProviderClient } from "../CognitoIdentityProviderClient"; +import { ListGroupsCommand, ListGroupsCommandInput, ListGroupsCommandOutput } from "../commands/ListGroupsCommand"; +import { CognitoIdentityProviderPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CognitoIdentityProviderClient, + input: ListGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListGroupsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CognitoIdentityProvider, + input: ListGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listGroups(input, ...args); +}; +export async function* listGroupsPaginate( + config: CognitoIdentityProviderPaginationConfiguration, + input: ListGroupsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListGroupsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["Limit"] = config.pageSize; + if (config.client instanceof CognitoIdentityProvider) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CognitoIdentityProviderClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CognitoIdentityProvider | CognitoIdentityProviderClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-cognito-identity-provider/pagination/ListIdentityProvidersPaginator.ts b/clients/client-cognito-identity-provider/pagination/ListIdentityProvidersPaginator.ts new file mode 100644 index 0000000000000..120bf03aa4b2e --- /dev/null +++ b/clients/client-cognito-identity-provider/pagination/ListIdentityProvidersPaginator.ts @@ -0,0 +1,51 @@ +import { CognitoIdentityProvider } from "../CognitoIdentityProvider"; +import { CognitoIdentityProviderClient } from "../CognitoIdentityProviderClient"; +import { + ListIdentityProvidersCommand, + ListIdentityProvidersCommandInput, + ListIdentityProvidersCommandOutput, +} from "../commands/ListIdentityProvidersCommand"; +import { CognitoIdentityProviderPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CognitoIdentityProviderClient, + input: ListIdentityProvidersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListIdentityProvidersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CognitoIdentityProvider, + input: ListIdentityProvidersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listIdentityProviders(input, ...args); +}; +export async function* listIdentityProvidersPaginate( + config: CognitoIdentityProviderPaginationConfiguration, + input: ListIdentityProvidersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListIdentityProvidersCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof CognitoIdentityProvider) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CognitoIdentityProviderClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CognitoIdentityProvider | CognitoIdentityProviderClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-cognito-identity-provider/pagination/ListResourceServersPaginator.ts b/clients/client-cognito-identity-provider/pagination/ListResourceServersPaginator.ts new file mode 100644 index 0000000000000..df7c2bd9e194b --- /dev/null +++ b/clients/client-cognito-identity-provider/pagination/ListResourceServersPaginator.ts @@ -0,0 +1,51 @@ +import { CognitoIdentityProvider } from "../CognitoIdentityProvider"; +import { CognitoIdentityProviderClient } from "../CognitoIdentityProviderClient"; +import { + ListResourceServersCommand, + ListResourceServersCommandInput, + ListResourceServersCommandOutput, +} from "../commands/ListResourceServersCommand"; +import { CognitoIdentityProviderPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CognitoIdentityProviderClient, + input: ListResourceServersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListResourceServersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CognitoIdentityProvider, + input: ListResourceServersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listResourceServers(input, ...args); +}; +export async function* listResourceServersPaginate( + config: CognitoIdentityProviderPaginationConfiguration, + input: ListResourceServersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListResourceServersCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof CognitoIdentityProvider) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CognitoIdentityProviderClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CognitoIdentityProvider | CognitoIdentityProviderClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-cognito-identity-provider/pagination/ListUserPoolClientsPaginator.ts b/clients/client-cognito-identity-provider/pagination/ListUserPoolClientsPaginator.ts new file mode 100644 index 0000000000000..3ec5ced4ed247 --- /dev/null +++ b/clients/client-cognito-identity-provider/pagination/ListUserPoolClientsPaginator.ts @@ -0,0 +1,51 @@ +import { CognitoIdentityProvider } from "../CognitoIdentityProvider"; +import { CognitoIdentityProviderClient } from "../CognitoIdentityProviderClient"; +import { + ListUserPoolClientsCommand, + ListUserPoolClientsCommandInput, + ListUserPoolClientsCommandOutput, +} from "../commands/ListUserPoolClientsCommand"; +import { CognitoIdentityProviderPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CognitoIdentityProviderClient, + input: ListUserPoolClientsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListUserPoolClientsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CognitoIdentityProvider, + input: ListUserPoolClientsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listUserPoolClients(input, ...args); +}; +export async function* listUserPoolClientsPaginate( + config: CognitoIdentityProviderPaginationConfiguration, + input: ListUserPoolClientsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListUserPoolClientsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof CognitoIdentityProvider) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CognitoIdentityProviderClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CognitoIdentityProvider | CognitoIdentityProviderClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-cognito-identity-provider/pagination/ListUsersInGroupPaginator.ts b/clients/client-cognito-identity-provider/pagination/ListUsersInGroupPaginator.ts new file mode 100644 index 0000000000000..c471c222c8733 --- /dev/null +++ b/clients/client-cognito-identity-provider/pagination/ListUsersInGroupPaginator.ts @@ -0,0 +1,51 @@ +import { CognitoIdentityProvider } from "../CognitoIdentityProvider"; +import { CognitoIdentityProviderClient } from "../CognitoIdentityProviderClient"; +import { + ListUsersInGroupCommand, + ListUsersInGroupCommandInput, + ListUsersInGroupCommandOutput, +} from "../commands/ListUsersInGroupCommand"; +import { CognitoIdentityProviderPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CognitoIdentityProviderClient, + input: ListUsersInGroupCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListUsersInGroupCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CognitoIdentityProvider, + input: ListUsersInGroupCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listUsersInGroup(input, ...args); +}; +export async function* listUsersInGroupPaginate( + config: CognitoIdentityProviderPaginationConfiguration, + input: ListUsersInGroupCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListUsersInGroupCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["Limit"] = config.pageSize; + if (config.client instanceof CognitoIdentityProvider) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CognitoIdentityProviderClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CognitoIdentityProvider | CognitoIdentityProviderClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-cognito-identity-provider/pagination/ListUsersPaginator.ts b/clients/client-cognito-identity-provider/pagination/ListUsersPaginator.ts new file mode 100644 index 0000000000000..8f78d8a123a91 --- /dev/null +++ b/clients/client-cognito-identity-provider/pagination/ListUsersPaginator.ts @@ -0,0 +1,47 @@ +import { CognitoIdentityProvider } from "../CognitoIdentityProvider"; +import { CognitoIdentityProviderClient } from "../CognitoIdentityProviderClient"; +import { ListUsersCommand, ListUsersCommandInput, ListUsersCommandOutput } from "../commands/ListUsersCommand"; +import { CognitoIdentityProviderPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CognitoIdentityProviderClient, + input: ListUsersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListUsersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CognitoIdentityProvider, + input: ListUsersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listUsers(input, ...args); +}; +export async function* listUsersPaginate( + config: CognitoIdentityProviderPaginationConfiguration, + input: ListUsersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListUsersCommandOutput; + while (hasNext) { + input["PaginationToken"] = token; + input["Limit"] = config.pageSize; + if (config.client instanceof CognitoIdentityProvider) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CognitoIdentityProviderClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CognitoIdentityProvider | CognitoIdentityProviderClient"); + } + yield page; + token = page["PaginationToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-comprehend/index.ts b/clients/client-comprehend/index.ts index 744d7ca2a6f98..2c524e9e29be2 100644 --- a/clients/client-comprehend/index.ts +++ b/clients/client-comprehend/index.ts @@ -27,15 +27,23 @@ export * from "./commands/DetectKeyPhrasesCommand"; export * from "./commands/DetectSentimentCommand"; export * from "./commands/DetectSyntaxCommand"; export * from "./commands/ListDocumentClassificationJobsCommand"; +export * from "./pagination/ListDocumentClassificationJobsPaginator"; export * from "./commands/ListDocumentClassifiersCommand"; +export * from "./pagination/ListDocumentClassifiersPaginator"; export * from "./commands/ListDominantLanguageDetectionJobsCommand"; +export * from "./pagination/ListDominantLanguageDetectionJobsPaginator"; export * from "./commands/ListEndpointsCommand"; export * from "./commands/ListEntitiesDetectionJobsCommand"; +export * from "./pagination/ListEntitiesDetectionJobsPaginator"; export * from "./commands/ListEntityRecognizersCommand"; +export * from "./pagination/ListEntityRecognizersPaginator"; export * from "./commands/ListKeyPhrasesDetectionJobsCommand"; +export * from "./pagination/ListKeyPhrasesDetectionJobsPaginator"; export * from "./commands/ListSentimentDetectionJobsCommand"; +export * from "./pagination/ListSentimentDetectionJobsPaginator"; export * from "./commands/ListTagsForResourceCommand"; export * from "./commands/ListTopicsDetectionJobsCommand"; +export * from "./pagination/ListTopicsDetectionJobsPaginator"; export * from "./commands/StartDocumentClassificationJobCommand"; export * from "./commands/StartDominantLanguageDetectionJobCommand"; export * from "./commands/StartEntitiesDetectionJobCommand"; @@ -51,4 +59,5 @@ export * from "./commands/StopTrainingEntityRecognizerCommand"; export * from "./commands/TagResourceCommand"; export * from "./commands/UntagResourceCommand"; export * from "./commands/UpdateEndpointCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-comprehend/pagination/Interfaces.ts b/clients/client-comprehend/pagination/Interfaces.ts new file mode 100644 index 0000000000000..a2ffc1fde7b36 --- /dev/null +++ b/clients/client-comprehend/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { Comprehend } from "../Comprehend"; +import { ComprehendClient } from "../ComprehendClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface ComprehendPaginationConfiguration extends PaginationConfiguration { + client: Comprehend | ComprehendClient; +} diff --git a/clients/client-comprehend/pagination/ListDocumentClassificationJobsPaginator.ts b/clients/client-comprehend/pagination/ListDocumentClassificationJobsPaginator.ts new file mode 100644 index 0000000000000..9d955d3300353 --- /dev/null +++ b/clients/client-comprehend/pagination/ListDocumentClassificationJobsPaginator.ts @@ -0,0 +1,51 @@ +import { Comprehend } from "../Comprehend"; +import { ComprehendClient } from "../ComprehendClient"; +import { + ListDocumentClassificationJobsCommand, + ListDocumentClassificationJobsCommandInput, + ListDocumentClassificationJobsCommandOutput, +} from "../commands/ListDocumentClassificationJobsCommand"; +import { ComprehendPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ComprehendClient, + input: ListDocumentClassificationJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDocumentClassificationJobsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Comprehend, + input: ListDocumentClassificationJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDocumentClassificationJobs(input, ...args); +}; +export async function* listDocumentClassificationJobsPaginate( + config: ComprehendPaginationConfiguration, + input: ListDocumentClassificationJobsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDocumentClassificationJobsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Comprehend) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ComprehendClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Comprehend | ComprehendClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-comprehend/pagination/ListDocumentClassifiersPaginator.ts b/clients/client-comprehend/pagination/ListDocumentClassifiersPaginator.ts new file mode 100644 index 0000000000000..35e230c89557b --- /dev/null +++ b/clients/client-comprehend/pagination/ListDocumentClassifiersPaginator.ts @@ -0,0 +1,51 @@ +import { Comprehend } from "../Comprehend"; +import { ComprehendClient } from "../ComprehendClient"; +import { + ListDocumentClassifiersCommand, + ListDocumentClassifiersCommandInput, + ListDocumentClassifiersCommandOutput, +} from "../commands/ListDocumentClassifiersCommand"; +import { ComprehendPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ComprehendClient, + input: ListDocumentClassifiersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDocumentClassifiersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Comprehend, + input: ListDocumentClassifiersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDocumentClassifiers(input, ...args); +}; +export async function* listDocumentClassifiersPaginate( + config: ComprehendPaginationConfiguration, + input: ListDocumentClassifiersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDocumentClassifiersCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Comprehend) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ComprehendClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Comprehend | ComprehendClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-comprehend/pagination/ListDominantLanguageDetectionJobsPaginator.ts b/clients/client-comprehend/pagination/ListDominantLanguageDetectionJobsPaginator.ts new file mode 100644 index 0000000000000..370579a1aadc1 --- /dev/null +++ b/clients/client-comprehend/pagination/ListDominantLanguageDetectionJobsPaginator.ts @@ -0,0 +1,51 @@ +import { Comprehend } from "../Comprehend"; +import { ComprehendClient } from "../ComprehendClient"; +import { + ListDominantLanguageDetectionJobsCommand, + ListDominantLanguageDetectionJobsCommandInput, + ListDominantLanguageDetectionJobsCommandOutput, +} from "../commands/ListDominantLanguageDetectionJobsCommand"; +import { ComprehendPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ComprehendClient, + input: ListDominantLanguageDetectionJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDominantLanguageDetectionJobsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Comprehend, + input: ListDominantLanguageDetectionJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDominantLanguageDetectionJobs(input, ...args); +}; +export async function* listDominantLanguageDetectionJobsPaginate( + config: ComprehendPaginationConfiguration, + input: ListDominantLanguageDetectionJobsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDominantLanguageDetectionJobsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Comprehend) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ComprehendClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Comprehend | ComprehendClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-comprehend/pagination/ListEntitiesDetectionJobsPaginator.ts b/clients/client-comprehend/pagination/ListEntitiesDetectionJobsPaginator.ts new file mode 100644 index 0000000000000..3ab3694834e48 --- /dev/null +++ b/clients/client-comprehend/pagination/ListEntitiesDetectionJobsPaginator.ts @@ -0,0 +1,51 @@ +import { Comprehend } from "../Comprehend"; +import { ComprehendClient } from "../ComprehendClient"; +import { + ListEntitiesDetectionJobsCommand, + ListEntitiesDetectionJobsCommandInput, + ListEntitiesDetectionJobsCommandOutput, +} from "../commands/ListEntitiesDetectionJobsCommand"; +import { ComprehendPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ComprehendClient, + input: ListEntitiesDetectionJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListEntitiesDetectionJobsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Comprehend, + input: ListEntitiesDetectionJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listEntitiesDetectionJobs(input, ...args); +}; +export async function* listEntitiesDetectionJobsPaginate( + config: ComprehendPaginationConfiguration, + input: ListEntitiesDetectionJobsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListEntitiesDetectionJobsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Comprehend) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ComprehendClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Comprehend | ComprehendClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-comprehend/pagination/ListEntityRecognizersPaginator.ts b/clients/client-comprehend/pagination/ListEntityRecognizersPaginator.ts new file mode 100644 index 0000000000000..d537f397879eb --- /dev/null +++ b/clients/client-comprehend/pagination/ListEntityRecognizersPaginator.ts @@ -0,0 +1,51 @@ +import { Comprehend } from "../Comprehend"; +import { ComprehendClient } from "../ComprehendClient"; +import { + ListEntityRecognizersCommand, + ListEntityRecognizersCommandInput, + ListEntityRecognizersCommandOutput, +} from "../commands/ListEntityRecognizersCommand"; +import { ComprehendPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ComprehendClient, + input: ListEntityRecognizersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListEntityRecognizersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Comprehend, + input: ListEntityRecognizersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listEntityRecognizers(input, ...args); +}; +export async function* listEntityRecognizersPaginate( + config: ComprehendPaginationConfiguration, + input: ListEntityRecognizersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListEntityRecognizersCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Comprehend) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ComprehendClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Comprehend | ComprehendClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-comprehend/pagination/ListKeyPhrasesDetectionJobsPaginator.ts b/clients/client-comprehend/pagination/ListKeyPhrasesDetectionJobsPaginator.ts new file mode 100644 index 0000000000000..d5e99e4c2631f --- /dev/null +++ b/clients/client-comprehend/pagination/ListKeyPhrasesDetectionJobsPaginator.ts @@ -0,0 +1,51 @@ +import { Comprehend } from "../Comprehend"; +import { ComprehendClient } from "../ComprehendClient"; +import { + ListKeyPhrasesDetectionJobsCommand, + ListKeyPhrasesDetectionJobsCommandInput, + ListKeyPhrasesDetectionJobsCommandOutput, +} from "../commands/ListKeyPhrasesDetectionJobsCommand"; +import { ComprehendPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ComprehendClient, + input: ListKeyPhrasesDetectionJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListKeyPhrasesDetectionJobsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Comprehend, + input: ListKeyPhrasesDetectionJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listKeyPhrasesDetectionJobs(input, ...args); +}; +export async function* listKeyPhrasesDetectionJobsPaginate( + config: ComprehendPaginationConfiguration, + input: ListKeyPhrasesDetectionJobsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListKeyPhrasesDetectionJobsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Comprehend) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ComprehendClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Comprehend | ComprehendClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-comprehend/pagination/ListSentimentDetectionJobsPaginator.ts b/clients/client-comprehend/pagination/ListSentimentDetectionJobsPaginator.ts new file mode 100644 index 0000000000000..b6089944c765d --- /dev/null +++ b/clients/client-comprehend/pagination/ListSentimentDetectionJobsPaginator.ts @@ -0,0 +1,51 @@ +import { Comprehend } from "../Comprehend"; +import { ComprehendClient } from "../ComprehendClient"; +import { + ListSentimentDetectionJobsCommand, + ListSentimentDetectionJobsCommandInput, + ListSentimentDetectionJobsCommandOutput, +} from "../commands/ListSentimentDetectionJobsCommand"; +import { ComprehendPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ComprehendClient, + input: ListSentimentDetectionJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListSentimentDetectionJobsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Comprehend, + input: ListSentimentDetectionJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listSentimentDetectionJobs(input, ...args); +}; +export async function* listSentimentDetectionJobsPaginate( + config: ComprehendPaginationConfiguration, + input: ListSentimentDetectionJobsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListSentimentDetectionJobsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Comprehend) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ComprehendClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Comprehend | ComprehendClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-comprehend/pagination/ListTopicsDetectionJobsPaginator.ts b/clients/client-comprehend/pagination/ListTopicsDetectionJobsPaginator.ts new file mode 100644 index 0000000000000..d944aa4d5dd9c --- /dev/null +++ b/clients/client-comprehend/pagination/ListTopicsDetectionJobsPaginator.ts @@ -0,0 +1,51 @@ +import { Comprehend } from "../Comprehend"; +import { ComprehendClient } from "../ComprehendClient"; +import { + ListTopicsDetectionJobsCommand, + ListTopicsDetectionJobsCommandInput, + ListTopicsDetectionJobsCommandOutput, +} from "../commands/ListTopicsDetectionJobsCommand"; +import { ComprehendPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ComprehendClient, + input: ListTopicsDetectionJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTopicsDetectionJobsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Comprehend, + input: ListTopicsDetectionJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTopicsDetectionJobs(input, ...args); +}; +export async function* listTopicsDetectionJobsPaginate( + config: ComprehendPaginationConfiguration, + input: ListTopicsDetectionJobsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTopicsDetectionJobsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Comprehend) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ComprehendClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Comprehend | ComprehendClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-config-service/index.ts b/clients/client-config-service/index.ts index bace91018f6bd..e7496f76795d8 100644 --- a/clients/client-config-service/index.ts +++ b/clients/client-config-service/index.ts @@ -39,7 +39,9 @@ export * from "./commands/DescribeOrganizationConformancePackStatusesCommand"; export * from "./commands/DescribePendingAggregationRequestsCommand"; export * from "./commands/DescribeRemediationConfigurationsCommand"; export * from "./commands/DescribeRemediationExceptionsCommand"; +export * from "./pagination/DescribeRemediationExceptionsPaginator"; export * from "./commands/DescribeRemediationExecutionStatusCommand"; +export * from "./pagination/DescribeRemediationExecutionStatusPaginator"; export * from "./commands/DescribeRetentionConfigurationsCommand"; export * from "./commands/GetAggregateComplianceDetailsByConfigRuleCommand"; export * from "./commands/GetAggregateConfigRuleComplianceSummaryCommand"; @@ -55,6 +57,7 @@ export * from "./commands/GetDiscoveredResourceCountsCommand"; export * from "./commands/GetOrganizationConfigRuleDetailedStatusCommand"; export * from "./commands/GetOrganizationConformancePackDetailedStatusCommand"; export * from "./commands/GetResourceConfigHistoryCommand"; +export * from "./pagination/GetResourceConfigHistoryPaginator"; export * from "./commands/ListAggregateDiscoveredResourcesCommand"; export * from "./commands/ListDiscoveredResourcesCommand"; export * from "./commands/ListTagsForResourceCommand"; @@ -72,6 +75,7 @@ export * from "./commands/PutRemediationExceptionsCommand"; export * from "./commands/PutResourceConfigCommand"; export * from "./commands/PutRetentionConfigurationCommand"; export * from "./commands/SelectAggregateResourceConfigCommand"; +export * from "./pagination/SelectAggregateResourceConfigPaginator"; export * from "./commands/SelectResourceConfigCommand"; export * from "./commands/StartConfigRulesEvaluationCommand"; export * from "./commands/StartConfigurationRecorderCommand"; @@ -79,4 +83,5 @@ export * from "./commands/StartRemediationExecutionCommand"; export * from "./commands/StopConfigurationRecorderCommand"; export * from "./commands/TagResourceCommand"; export * from "./commands/UntagResourceCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-config-service/pagination/DescribeRemediationExceptionsPaginator.ts b/clients/client-config-service/pagination/DescribeRemediationExceptionsPaginator.ts new file mode 100644 index 0000000000000..f431d23320979 --- /dev/null +++ b/clients/client-config-service/pagination/DescribeRemediationExceptionsPaginator.ts @@ -0,0 +1,51 @@ +import { ConfigService } from "../ConfigService"; +import { ConfigServiceClient } from "../ConfigServiceClient"; +import { + DescribeRemediationExceptionsCommand, + DescribeRemediationExceptionsCommandInput, + DescribeRemediationExceptionsCommandOutput, +} from "../commands/DescribeRemediationExceptionsCommand"; +import { ConfigServicePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ConfigServiceClient, + input: DescribeRemediationExceptionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeRemediationExceptionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ConfigService, + input: DescribeRemediationExceptionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeRemediationExceptions(input, ...args); +}; +export async function* describeRemediationExceptionsPaginate( + config: ConfigServicePaginationConfiguration, + input: DescribeRemediationExceptionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeRemediationExceptionsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["Limit"] = config.pageSize; + if (config.client instanceof ConfigService) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ConfigServiceClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ConfigService | ConfigServiceClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-config-service/pagination/DescribeRemediationExecutionStatusPaginator.ts b/clients/client-config-service/pagination/DescribeRemediationExecutionStatusPaginator.ts new file mode 100644 index 0000000000000..29253f9137eb4 --- /dev/null +++ b/clients/client-config-service/pagination/DescribeRemediationExecutionStatusPaginator.ts @@ -0,0 +1,51 @@ +import { ConfigService } from "../ConfigService"; +import { ConfigServiceClient } from "../ConfigServiceClient"; +import { + DescribeRemediationExecutionStatusCommand, + DescribeRemediationExecutionStatusCommandInput, + DescribeRemediationExecutionStatusCommandOutput, +} from "../commands/DescribeRemediationExecutionStatusCommand"; +import { ConfigServicePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ConfigServiceClient, + input: DescribeRemediationExecutionStatusCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeRemediationExecutionStatusCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ConfigService, + input: DescribeRemediationExecutionStatusCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeRemediationExecutionStatus(input, ...args); +}; +export async function* describeRemediationExecutionStatusPaginate( + config: ConfigServicePaginationConfiguration, + input: DescribeRemediationExecutionStatusCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeRemediationExecutionStatusCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["Limit"] = config.pageSize; + if (config.client instanceof ConfigService) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ConfigServiceClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ConfigService | ConfigServiceClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-config-service/pagination/GetResourceConfigHistoryPaginator.ts b/clients/client-config-service/pagination/GetResourceConfigHistoryPaginator.ts new file mode 100644 index 0000000000000..e8bbb6261fbcd --- /dev/null +++ b/clients/client-config-service/pagination/GetResourceConfigHistoryPaginator.ts @@ -0,0 +1,51 @@ +import { ConfigService } from "../ConfigService"; +import { ConfigServiceClient } from "../ConfigServiceClient"; +import { + GetResourceConfigHistoryCommand, + GetResourceConfigHistoryCommandInput, + GetResourceConfigHistoryCommandOutput, +} from "../commands/GetResourceConfigHistoryCommand"; +import { ConfigServicePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ConfigServiceClient, + input: GetResourceConfigHistoryCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetResourceConfigHistoryCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ConfigService, + input: GetResourceConfigHistoryCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getResourceConfigHistory(input, ...args); +}; +export async function* getResourceConfigHistoryPaginate( + config: ConfigServicePaginationConfiguration, + input: GetResourceConfigHistoryCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetResourceConfigHistoryCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["limit"] = config.pageSize; + if (config.client instanceof ConfigService) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ConfigServiceClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ConfigService | ConfigServiceClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-config-service/pagination/Interfaces.ts b/clients/client-config-service/pagination/Interfaces.ts new file mode 100644 index 0000000000000..3ef45f4a1e795 --- /dev/null +++ b/clients/client-config-service/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { ConfigService } from "../ConfigService"; +import { ConfigServiceClient } from "../ConfigServiceClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface ConfigServicePaginationConfiguration extends PaginationConfiguration { + client: ConfigService | ConfigServiceClient; +} diff --git a/clients/client-config-service/pagination/SelectAggregateResourceConfigPaginator.ts b/clients/client-config-service/pagination/SelectAggregateResourceConfigPaginator.ts new file mode 100644 index 0000000000000..494520ccf7bc8 --- /dev/null +++ b/clients/client-config-service/pagination/SelectAggregateResourceConfigPaginator.ts @@ -0,0 +1,51 @@ +import { ConfigService } from "../ConfigService"; +import { ConfigServiceClient } from "../ConfigServiceClient"; +import { + SelectAggregateResourceConfigCommand, + SelectAggregateResourceConfigCommandInput, + SelectAggregateResourceConfigCommandOutput, +} from "../commands/SelectAggregateResourceConfigCommand"; +import { ConfigServicePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ConfigServiceClient, + input: SelectAggregateResourceConfigCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new SelectAggregateResourceConfigCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ConfigService, + input: SelectAggregateResourceConfigCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.selectAggregateResourceConfig(input, ...args); +}; +export async function* selectAggregateResourceConfigPaginate( + config: ConfigServicePaginationConfiguration, + input: SelectAggregateResourceConfigCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: SelectAggregateResourceConfigCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof ConfigService) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ConfigServiceClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ConfigService | ConfigServiceClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-connect/index.ts b/clients/client-connect/index.ts index aa1f095d3e680..d0700584cd05f 100644 --- a/clients/client-connect/index.ts +++ b/clients/client-connect/index.ts @@ -7,17 +7,27 @@ export * from "./commands/DescribeUserHierarchyGroupCommand"; export * from "./commands/DescribeUserHierarchyStructureCommand"; export * from "./commands/GetContactAttributesCommand"; export * from "./commands/GetCurrentMetricDataCommand"; +export * from "./pagination/GetCurrentMetricDataPaginator"; export * from "./commands/GetFederationTokenCommand"; export * from "./commands/GetMetricDataCommand"; +export * from "./pagination/GetMetricDataPaginator"; export * from "./commands/ListContactFlowsCommand"; +export * from "./pagination/ListContactFlowsPaginator"; export * from "./commands/ListHoursOfOperationsCommand"; +export * from "./pagination/ListHoursOfOperationsPaginator"; export * from "./commands/ListPhoneNumbersCommand"; +export * from "./pagination/ListPhoneNumbersPaginator"; export * from "./commands/ListQueuesCommand"; +export * from "./pagination/ListQueuesPaginator"; export * from "./commands/ListRoutingProfilesCommand"; +export * from "./pagination/ListRoutingProfilesPaginator"; export * from "./commands/ListSecurityProfilesCommand"; +export * from "./pagination/ListSecurityProfilesPaginator"; export * from "./commands/ListTagsForResourceCommand"; export * from "./commands/ListUserHierarchyGroupsCommand"; +export * from "./pagination/ListUserHierarchyGroupsPaginator"; export * from "./commands/ListUsersCommand"; +export * from "./pagination/ListUsersPaginator"; export * from "./commands/ResumeContactRecordingCommand"; export * from "./commands/StartChatContactCommand"; export * from "./commands/StartContactRecordingCommand"; @@ -33,4 +43,5 @@ export * from "./commands/UpdateUserIdentityInfoCommand"; export * from "./commands/UpdateUserPhoneConfigCommand"; export * from "./commands/UpdateUserRoutingProfileCommand"; export * from "./commands/UpdateUserSecurityProfilesCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-connect/pagination/GetCurrentMetricDataPaginator.ts b/clients/client-connect/pagination/GetCurrentMetricDataPaginator.ts new file mode 100644 index 0000000000000..778eb9d58e8bc --- /dev/null +++ b/clients/client-connect/pagination/GetCurrentMetricDataPaginator.ts @@ -0,0 +1,51 @@ +import { Connect } from "../Connect"; +import { ConnectClient } from "../ConnectClient"; +import { + GetCurrentMetricDataCommand, + GetCurrentMetricDataCommandInput, + GetCurrentMetricDataCommandOutput, +} from "../commands/GetCurrentMetricDataCommand"; +import { ConnectPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ConnectClient, + input: GetCurrentMetricDataCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetCurrentMetricDataCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Connect, + input: GetCurrentMetricDataCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getCurrentMetricData(input, ...args); +}; +export async function* getCurrentMetricDataPaginate( + config: ConnectPaginationConfiguration, + input: GetCurrentMetricDataCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetCurrentMetricDataCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Connect) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ConnectClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Connect | ConnectClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-connect/pagination/GetMetricDataPaginator.ts b/clients/client-connect/pagination/GetMetricDataPaginator.ts new file mode 100644 index 0000000000000..61908fbc47236 --- /dev/null +++ b/clients/client-connect/pagination/GetMetricDataPaginator.ts @@ -0,0 +1,51 @@ +import { Connect } from "../Connect"; +import { ConnectClient } from "../ConnectClient"; +import { + GetMetricDataCommand, + GetMetricDataCommandInput, + GetMetricDataCommandOutput, +} from "../commands/GetMetricDataCommand"; +import { ConnectPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ConnectClient, + input: GetMetricDataCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetMetricDataCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Connect, + input: GetMetricDataCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getMetricData(input, ...args); +}; +export async function* getMetricDataPaginate( + config: ConnectPaginationConfiguration, + input: GetMetricDataCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetMetricDataCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Connect) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ConnectClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Connect | ConnectClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-connect/pagination/Interfaces.ts b/clients/client-connect/pagination/Interfaces.ts new file mode 100644 index 0000000000000..9d56c51493b93 --- /dev/null +++ b/clients/client-connect/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { Connect } from "../Connect"; +import { ConnectClient } from "../ConnectClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface ConnectPaginationConfiguration extends PaginationConfiguration { + client: Connect | ConnectClient; +} diff --git a/clients/client-connect/pagination/ListContactFlowsPaginator.ts b/clients/client-connect/pagination/ListContactFlowsPaginator.ts new file mode 100644 index 0000000000000..84046689b0a47 --- /dev/null +++ b/clients/client-connect/pagination/ListContactFlowsPaginator.ts @@ -0,0 +1,51 @@ +import { Connect } from "../Connect"; +import { ConnectClient } from "../ConnectClient"; +import { + ListContactFlowsCommand, + ListContactFlowsCommandInput, + ListContactFlowsCommandOutput, +} from "../commands/ListContactFlowsCommand"; +import { ConnectPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ConnectClient, + input: ListContactFlowsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListContactFlowsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Connect, + input: ListContactFlowsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listContactFlows(input, ...args); +}; +export async function* listContactFlowsPaginate( + config: ConnectPaginationConfiguration, + input: ListContactFlowsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListContactFlowsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Connect) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ConnectClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Connect | ConnectClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-connect/pagination/ListHoursOfOperationsPaginator.ts b/clients/client-connect/pagination/ListHoursOfOperationsPaginator.ts new file mode 100644 index 0000000000000..fb0da9f53c464 --- /dev/null +++ b/clients/client-connect/pagination/ListHoursOfOperationsPaginator.ts @@ -0,0 +1,51 @@ +import { Connect } from "../Connect"; +import { ConnectClient } from "../ConnectClient"; +import { + ListHoursOfOperationsCommand, + ListHoursOfOperationsCommandInput, + ListHoursOfOperationsCommandOutput, +} from "../commands/ListHoursOfOperationsCommand"; +import { ConnectPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ConnectClient, + input: ListHoursOfOperationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListHoursOfOperationsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Connect, + input: ListHoursOfOperationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listHoursOfOperations(input, ...args); +}; +export async function* listHoursOfOperationsPaginate( + config: ConnectPaginationConfiguration, + input: ListHoursOfOperationsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListHoursOfOperationsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Connect) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ConnectClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Connect | ConnectClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-connect/pagination/ListPhoneNumbersPaginator.ts b/clients/client-connect/pagination/ListPhoneNumbersPaginator.ts new file mode 100644 index 0000000000000..434da1d3a6679 --- /dev/null +++ b/clients/client-connect/pagination/ListPhoneNumbersPaginator.ts @@ -0,0 +1,51 @@ +import { Connect } from "../Connect"; +import { ConnectClient } from "../ConnectClient"; +import { + ListPhoneNumbersCommand, + ListPhoneNumbersCommandInput, + ListPhoneNumbersCommandOutput, +} from "../commands/ListPhoneNumbersCommand"; +import { ConnectPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ConnectClient, + input: ListPhoneNumbersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListPhoneNumbersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Connect, + input: ListPhoneNumbersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listPhoneNumbers(input, ...args); +}; +export async function* listPhoneNumbersPaginate( + config: ConnectPaginationConfiguration, + input: ListPhoneNumbersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListPhoneNumbersCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Connect) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ConnectClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Connect | ConnectClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-connect/pagination/ListQueuesPaginator.ts b/clients/client-connect/pagination/ListQueuesPaginator.ts new file mode 100644 index 0000000000000..84e2485cae833 --- /dev/null +++ b/clients/client-connect/pagination/ListQueuesPaginator.ts @@ -0,0 +1,47 @@ +import { Connect } from "../Connect"; +import { ConnectClient } from "../ConnectClient"; +import { ListQueuesCommand, ListQueuesCommandInput, ListQueuesCommandOutput } from "../commands/ListQueuesCommand"; +import { ConnectPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ConnectClient, + input: ListQueuesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListQueuesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Connect, + input: ListQueuesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listQueues(input, ...args); +}; +export async function* listQueuesPaginate( + config: ConnectPaginationConfiguration, + input: ListQueuesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListQueuesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Connect) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ConnectClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Connect | ConnectClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-connect/pagination/ListRoutingProfilesPaginator.ts b/clients/client-connect/pagination/ListRoutingProfilesPaginator.ts new file mode 100644 index 0000000000000..41cc24b88846c --- /dev/null +++ b/clients/client-connect/pagination/ListRoutingProfilesPaginator.ts @@ -0,0 +1,51 @@ +import { Connect } from "../Connect"; +import { ConnectClient } from "../ConnectClient"; +import { + ListRoutingProfilesCommand, + ListRoutingProfilesCommandInput, + ListRoutingProfilesCommandOutput, +} from "../commands/ListRoutingProfilesCommand"; +import { ConnectPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ConnectClient, + input: ListRoutingProfilesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListRoutingProfilesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Connect, + input: ListRoutingProfilesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listRoutingProfiles(input, ...args); +}; +export async function* listRoutingProfilesPaginate( + config: ConnectPaginationConfiguration, + input: ListRoutingProfilesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListRoutingProfilesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Connect) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ConnectClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Connect | ConnectClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-connect/pagination/ListSecurityProfilesPaginator.ts b/clients/client-connect/pagination/ListSecurityProfilesPaginator.ts new file mode 100644 index 0000000000000..18955f3db85de --- /dev/null +++ b/clients/client-connect/pagination/ListSecurityProfilesPaginator.ts @@ -0,0 +1,51 @@ +import { Connect } from "../Connect"; +import { ConnectClient } from "../ConnectClient"; +import { + ListSecurityProfilesCommand, + ListSecurityProfilesCommandInput, + ListSecurityProfilesCommandOutput, +} from "../commands/ListSecurityProfilesCommand"; +import { ConnectPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ConnectClient, + input: ListSecurityProfilesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListSecurityProfilesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Connect, + input: ListSecurityProfilesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listSecurityProfiles(input, ...args); +}; +export async function* listSecurityProfilesPaginate( + config: ConnectPaginationConfiguration, + input: ListSecurityProfilesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListSecurityProfilesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Connect) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ConnectClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Connect | ConnectClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-connect/pagination/ListUserHierarchyGroupsPaginator.ts b/clients/client-connect/pagination/ListUserHierarchyGroupsPaginator.ts new file mode 100644 index 0000000000000..edcac52f32087 --- /dev/null +++ b/clients/client-connect/pagination/ListUserHierarchyGroupsPaginator.ts @@ -0,0 +1,51 @@ +import { Connect } from "../Connect"; +import { ConnectClient } from "../ConnectClient"; +import { + ListUserHierarchyGroupsCommand, + ListUserHierarchyGroupsCommandInput, + ListUserHierarchyGroupsCommandOutput, +} from "../commands/ListUserHierarchyGroupsCommand"; +import { ConnectPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ConnectClient, + input: ListUserHierarchyGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListUserHierarchyGroupsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Connect, + input: ListUserHierarchyGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listUserHierarchyGroups(input, ...args); +}; +export async function* listUserHierarchyGroupsPaginate( + config: ConnectPaginationConfiguration, + input: ListUserHierarchyGroupsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListUserHierarchyGroupsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Connect) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ConnectClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Connect | ConnectClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-connect/pagination/ListUsersPaginator.ts b/clients/client-connect/pagination/ListUsersPaginator.ts new file mode 100644 index 0000000000000..fead4d2c93739 --- /dev/null +++ b/clients/client-connect/pagination/ListUsersPaginator.ts @@ -0,0 +1,47 @@ +import { Connect } from "../Connect"; +import { ConnectClient } from "../ConnectClient"; +import { ListUsersCommand, ListUsersCommandInput, ListUsersCommandOutput } from "../commands/ListUsersCommand"; +import { ConnectPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ConnectClient, + input: ListUsersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListUsersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Connect, + input: ListUsersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listUsers(input, ...args); +}; +export async function* listUsersPaginate( + config: ConnectPaginationConfiguration, + input: ListUsersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListUsersCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Connect) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ConnectClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Connect | ConnectClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-connectparticipant/index.ts b/clients/client-connectparticipant/index.ts index 1290fcc5c134a..d81b126439217 100644 --- a/clients/client-connectparticipant/index.ts +++ b/clients/client-connectparticipant/index.ts @@ -3,6 +3,8 @@ export * from "./ConnectParticipant"; export * from "./commands/CreateParticipantConnectionCommand"; export * from "./commands/DisconnectParticipantCommand"; export * from "./commands/GetTranscriptCommand"; +export * from "./pagination/GetTranscriptPaginator"; export * from "./commands/SendEventCommand"; export * from "./commands/SendMessageCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-connectparticipant/pagination/GetTranscriptPaginator.ts b/clients/client-connectparticipant/pagination/GetTranscriptPaginator.ts new file mode 100644 index 0000000000000..f87111cdc01cc --- /dev/null +++ b/clients/client-connectparticipant/pagination/GetTranscriptPaginator.ts @@ -0,0 +1,51 @@ +import { ConnectParticipant } from "../ConnectParticipant"; +import { ConnectParticipantClient } from "../ConnectParticipantClient"; +import { + GetTranscriptCommand, + GetTranscriptCommandInput, + GetTranscriptCommandOutput, +} from "../commands/GetTranscriptCommand"; +import { ConnectParticipantPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ConnectParticipantClient, + input: GetTranscriptCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetTranscriptCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ConnectParticipant, + input: GetTranscriptCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getTranscript(input, ...args); +}; +export async function* getTranscriptPaginate( + config: ConnectParticipantPaginationConfiguration, + input: GetTranscriptCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetTranscriptCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof ConnectParticipant) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ConnectParticipantClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ConnectParticipant | ConnectParticipantClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-connectparticipant/pagination/Interfaces.ts b/clients/client-connectparticipant/pagination/Interfaces.ts new file mode 100644 index 0000000000000..451a1a3fc45ee --- /dev/null +++ b/clients/client-connectparticipant/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { ConnectParticipant } from "../ConnectParticipant"; +import { ConnectParticipantClient } from "../ConnectParticipantClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface ConnectParticipantPaginationConfiguration extends PaginationConfiguration { + client: ConnectParticipant | ConnectParticipantClient; +} diff --git a/clients/client-cost-and-usage-report-service/index.ts b/clients/client-cost-and-usage-report-service/index.ts index 2cd5f3a9ed1e9..54273ab4fcae7 100644 --- a/clients/client-cost-and-usage-report-service/index.ts +++ b/clients/client-cost-and-usage-report-service/index.ts @@ -2,6 +2,8 @@ export * from "./CostAndUsageReportServiceClient"; export * from "./CostAndUsageReportService"; export * from "./commands/DeleteReportDefinitionCommand"; export * from "./commands/DescribeReportDefinitionsCommand"; +export * from "./pagination/DescribeReportDefinitionsPaginator"; export * from "./commands/ModifyReportDefinitionCommand"; export * from "./commands/PutReportDefinitionCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-cost-and-usage-report-service/pagination/DescribeReportDefinitionsPaginator.ts b/clients/client-cost-and-usage-report-service/pagination/DescribeReportDefinitionsPaginator.ts new file mode 100644 index 0000000000000..a5e552e225957 --- /dev/null +++ b/clients/client-cost-and-usage-report-service/pagination/DescribeReportDefinitionsPaginator.ts @@ -0,0 +1,51 @@ +import { CostAndUsageReportService } from "../CostAndUsageReportService"; +import { CostAndUsageReportServiceClient } from "../CostAndUsageReportServiceClient"; +import { + DescribeReportDefinitionsCommand, + DescribeReportDefinitionsCommandInput, + DescribeReportDefinitionsCommandOutput, +} from "../commands/DescribeReportDefinitionsCommand"; +import { CostAndUsageReportServicePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CostAndUsageReportServiceClient, + input: DescribeReportDefinitionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeReportDefinitionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CostAndUsageReportService, + input: DescribeReportDefinitionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeReportDefinitions(input, ...args); +}; +export async function* describeReportDefinitionsPaginate( + config: CostAndUsageReportServicePaginationConfiguration, + input: DescribeReportDefinitionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeReportDefinitionsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof CostAndUsageReportService) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CostAndUsageReportServiceClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CostAndUsageReportService | CostAndUsageReportServiceClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-cost-and-usage-report-service/pagination/Interfaces.ts b/clients/client-cost-and-usage-report-service/pagination/Interfaces.ts new file mode 100644 index 0000000000000..0de47061c1287 --- /dev/null +++ b/clients/client-cost-and-usage-report-service/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { CostAndUsageReportService } from "../CostAndUsageReportService"; +import { CostAndUsageReportServiceClient } from "../CostAndUsageReportServiceClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface CostAndUsageReportServicePaginationConfiguration extends PaginationConfiguration { + client: CostAndUsageReportService | CostAndUsageReportServiceClient; +} diff --git a/clients/client-cost-explorer/index.ts b/clients/client-cost-explorer/index.ts index c1f6dfbd02c16..b96f705c23eaa 100644 --- a/clients/client-cost-explorer/index.ts +++ b/clients/client-cost-explorer/index.ts @@ -12,11 +12,15 @@ export * from "./commands/GetReservationPurchaseRecommendationCommand"; export * from "./commands/GetReservationUtilizationCommand"; export * from "./commands/GetRightsizingRecommendationCommand"; export * from "./commands/GetSavingsPlansCoverageCommand"; +export * from "./pagination/GetSavingsPlansCoveragePaginator"; export * from "./commands/GetSavingsPlansPurchaseRecommendationCommand"; export * from "./commands/GetSavingsPlansUtilizationCommand"; export * from "./commands/GetSavingsPlansUtilizationDetailsCommand"; +export * from "./pagination/GetSavingsPlansUtilizationDetailsPaginator"; export * from "./commands/GetTagsCommand"; export * from "./commands/GetUsageForecastCommand"; export * from "./commands/ListCostCategoryDefinitionsCommand"; +export * from "./pagination/ListCostCategoryDefinitionsPaginator"; export * from "./commands/UpdateCostCategoryDefinitionCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-cost-explorer/pagination/GetSavingsPlansCoveragePaginator.ts b/clients/client-cost-explorer/pagination/GetSavingsPlansCoveragePaginator.ts new file mode 100644 index 0000000000000..4504f010bb4dc --- /dev/null +++ b/clients/client-cost-explorer/pagination/GetSavingsPlansCoveragePaginator.ts @@ -0,0 +1,51 @@ +import { CostExplorer } from "../CostExplorer"; +import { CostExplorerClient } from "../CostExplorerClient"; +import { + GetSavingsPlansCoverageCommand, + GetSavingsPlansCoverageCommandInput, + GetSavingsPlansCoverageCommandOutput, +} from "../commands/GetSavingsPlansCoverageCommand"; +import { CostExplorerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CostExplorerClient, + input: GetSavingsPlansCoverageCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetSavingsPlansCoverageCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CostExplorer, + input: GetSavingsPlansCoverageCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getSavingsPlansCoverage(input, ...args); +}; +export async function* getSavingsPlansCoveragePaginate( + config: CostExplorerPaginationConfiguration, + input: GetSavingsPlansCoverageCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetSavingsPlansCoverageCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof CostExplorer) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CostExplorerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CostExplorer | CostExplorerClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-cost-explorer/pagination/GetSavingsPlansUtilizationDetailsPaginator.ts b/clients/client-cost-explorer/pagination/GetSavingsPlansUtilizationDetailsPaginator.ts new file mode 100644 index 0000000000000..37d7c6ac69679 --- /dev/null +++ b/clients/client-cost-explorer/pagination/GetSavingsPlansUtilizationDetailsPaginator.ts @@ -0,0 +1,51 @@ +import { CostExplorer } from "../CostExplorer"; +import { CostExplorerClient } from "../CostExplorerClient"; +import { + GetSavingsPlansUtilizationDetailsCommand, + GetSavingsPlansUtilizationDetailsCommandInput, + GetSavingsPlansUtilizationDetailsCommandOutput, +} from "../commands/GetSavingsPlansUtilizationDetailsCommand"; +import { CostExplorerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CostExplorerClient, + input: GetSavingsPlansUtilizationDetailsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetSavingsPlansUtilizationDetailsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CostExplorer, + input: GetSavingsPlansUtilizationDetailsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getSavingsPlansUtilizationDetails(input, ...args); +}; +export async function* getSavingsPlansUtilizationDetailsPaginate( + config: CostExplorerPaginationConfiguration, + input: GetSavingsPlansUtilizationDetailsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetSavingsPlansUtilizationDetailsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof CostExplorer) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CostExplorerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CostExplorer | CostExplorerClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-cost-explorer/pagination/Interfaces.ts b/clients/client-cost-explorer/pagination/Interfaces.ts new file mode 100644 index 0000000000000..64f4dc6b2751b --- /dev/null +++ b/clients/client-cost-explorer/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { CostExplorer } from "../CostExplorer"; +import { CostExplorerClient } from "../CostExplorerClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface CostExplorerPaginationConfiguration extends PaginationConfiguration { + client: CostExplorer | CostExplorerClient; +} diff --git a/clients/client-cost-explorer/pagination/ListCostCategoryDefinitionsPaginator.ts b/clients/client-cost-explorer/pagination/ListCostCategoryDefinitionsPaginator.ts new file mode 100644 index 0000000000000..d44cfea2e8708 --- /dev/null +++ b/clients/client-cost-explorer/pagination/ListCostCategoryDefinitionsPaginator.ts @@ -0,0 +1,51 @@ +import { CostExplorer } from "../CostExplorer"; +import { CostExplorerClient } from "../CostExplorerClient"; +import { + ListCostCategoryDefinitionsCommand, + ListCostCategoryDefinitionsCommandInput, + ListCostCategoryDefinitionsCommandOutput, +} from "../commands/ListCostCategoryDefinitionsCommand"; +import { CostExplorerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: CostExplorerClient, + input: ListCostCategoryDefinitionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListCostCategoryDefinitionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: CostExplorer, + input: ListCostCategoryDefinitionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listCostCategoryDefinitions(input, ...args); +}; +export async function* listCostCategoryDefinitionsPaginate( + config: CostExplorerPaginationConfiguration, + input: ListCostCategoryDefinitionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListCostCategoryDefinitionsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof CostExplorer) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof CostExplorerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected CostExplorer | CostExplorerClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-data-pipeline/index.ts b/clients/client-data-pipeline/index.ts index 8e27449103901..515b85dfe2b81 100644 --- a/clients/client-data-pipeline/index.ts +++ b/clients/client-data-pipeline/index.ts @@ -6,17 +6,21 @@ export * from "./commands/CreatePipelineCommand"; export * from "./commands/DeactivatePipelineCommand"; export * from "./commands/DeletePipelineCommand"; export * from "./commands/DescribeObjectsCommand"; +export * from "./pagination/DescribeObjectsPaginator"; export * from "./commands/DescribePipelinesCommand"; export * from "./commands/EvaluateExpressionCommand"; export * from "./commands/GetPipelineDefinitionCommand"; export * from "./commands/ListPipelinesCommand"; +export * from "./pagination/ListPipelinesPaginator"; export * from "./commands/PollForTaskCommand"; export * from "./commands/PutPipelineDefinitionCommand"; export * from "./commands/QueryObjectsCommand"; +export * from "./pagination/QueryObjectsPaginator"; export * from "./commands/RemoveTagsCommand"; export * from "./commands/ReportTaskProgressCommand"; export * from "./commands/ReportTaskRunnerHeartbeatCommand"; export * from "./commands/SetStatusCommand"; export * from "./commands/SetTaskStatusCommand"; export * from "./commands/ValidatePipelineDefinitionCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-data-pipeline/pagination/DescribeObjectsPaginator.ts b/clients/client-data-pipeline/pagination/DescribeObjectsPaginator.ts new file mode 100644 index 0000000000000..7952b50e54d65 --- /dev/null +++ b/clients/client-data-pipeline/pagination/DescribeObjectsPaginator.ts @@ -0,0 +1,50 @@ +import { DataPipeline } from "../DataPipeline"; +import { DataPipelineClient } from "../DataPipelineClient"; +import { + DescribeObjectsCommand, + DescribeObjectsCommandInput, + DescribeObjectsCommandOutput, +} from "../commands/DescribeObjectsCommand"; +import { DataPipelinePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DataPipelineClient, + input: DescribeObjectsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeObjectsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DataPipeline, + input: DescribeObjectsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeObjects(input, ...args); +}; +export async function* describeObjectsPaginate( + config: DataPipelinePaginationConfiguration, + input: DescribeObjectsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeObjectsCommandOutput; + while (hasNext) { + input["marker"] = token; + if (config.client instanceof DataPipeline) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DataPipelineClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DataPipeline | DataPipelineClient"); + } + yield page; + token = page["marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-data-pipeline/pagination/Interfaces.ts b/clients/client-data-pipeline/pagination/Interfaces.ts new file mode 100644 index 0000000000000..f9de38e7676f7 --- /dev/null +++ b/clients/client-data-pipeline/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { DataPipeline } from "../DataPipeline"; +import { DataPipelineClient } from "../DataPipelineClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface DataPipelinePaginationConfiguration extends PaginationConfiguration { + client: DataPipeline | DataPipelineClient; +} diff --git a/clients/client-data-pipeline/pagination/ListPipelinesPaginator.ts b/clients/client-data-pipeline/pagination/ListPipelinesPaginator.ts new file mode 100644 index 0000000000000..c9211b70093e2 --- /dev/null +++ b/clients/client-data-pipeline/pagination/ListPipelinesPaginator.ts @@ -0,0 +1,50 @@ +import { DataPipeline } from "../DataPipeline"; +import { DataPipelineClient } from "../DataPipelineClient"; +import { + ListPipelinesCommand, + ListPipelinesCommandInput, + ListPipelinesCommandOutput, +} from "../commands/ListPipelinesCommand"; +import { DataPipelinePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DataPipelineClient, + input: ListPipelinesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListPipelinesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DataPipeline, + input: ListPipelinesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listPipelines(input, ...args); +}; +export async function* listPipelinesPaginate( + config: DataPipelinePaginationConfiguration, + input: ListPipelinesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListPipelinesCommandOutput; + while (hasNext) { + input["marker"] = token; + if (config.client instanceof DataPipeline) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DataPipelineClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DataPipeline | DataPipelineClient"); + } + yield page; + token = page["marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-data-pipeline/pagination/QueryObjectsPaginator.ts b/clients/client-data-pipeline/pagination/QueryObjectsPaginator.ts new file mode 100644 index 0000000000000..0904c0db26c03 --- /dev/null +++ b/clients/client-data-pipeline/pagination/QueryObjectsPaginator.ts @@ -0,0 +1,51 @@ +import { DataPipeline } from "../DataPipeline"; +import { DataPipelineClient } from "../DataPipelineClient"; +import { + QueryObjectsCommand, + QueryObjectsCommandInput, + QueryObjectsCommandOutput, +} from "../commands/QueryObjectsCommand"; +import { DataPipelinePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DataPipelineClient, + input: QueryObjectsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new QueryObjectsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DataPipeline, + input: QueryObjectsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.queryObjects(input, ...args); +}; +export async function* queryObjectsPaginate( + config: DataPipelinePaginationConfiguration, + input: QueryObjectsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: QueryObjectsCommandOutput; + while (hasNext) { + input["marker"] = token; + input["limit"] = config.pageSize; + if (config.client instanceof DataPipeline) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DataPipelineClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DataPipeline | DataPipelineClient"); + } + yield page; + token = page["marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-database-migration-service/index.ts b/clients/client-database-migration-service/index.ts index b70b77149fb5a..f46f3264e52be 100644 --- a/clients/client-database-migration-service/index.ts +++ b/clients/client-database-migration-service/index.ts @@ -18,25 +18,43 @@ export * from "./commands/DeleteReplicationTaskCommand"; export * from "./commands/DeleteReplicationTaskAssessmentRunCommand"; export * from "./commands/DescribeAccountAttributesCommand"; export * from "./commands/DescribeApplicableIndividualAssessmentsCommand"; +export * from "./pagination/DescribeApplicableIndividualAssessmentsPaginator"; export * from "./commands/DescribeCertificatesCommand"; +export * from "./pagination/DescribeCertificatesPaginator"; export * from "./commands/DescribeConnectionsCommand"; +export * from "./pagination/DescribeConnectionsPaginator"; export * from "./commands/DescribeEndpointsCommand"; +export * from "./pagination/DescribeEndpointsPaginator"; export * from "./commands/DescribeEndpointTypesCommand"; +export * from "./pagination/DescribeEndpointTypesPaginator"; export * from "./commands/DescribeEventCategoriesCommand"; export * from "./commands/DescribeEventsCommand"; +export * from "./pagination/DescribeEventsPaginator"; export * from "./commands/DescribeEventSubscriptionsCommand"; +export * from "./pagination/DescribeEventSubscriptionsPaginator"; export * from "./commands/DescribeOrderableReplicationInstancesCommand"; +export * from "./pagination/DescribeOrderableReplicationInstancesPaginator"; export * from "./commands/DescribePendingMaintenanceActionsCommand"; +export * from "./pagination/DescribePendingMaintenanceActionsPaginator"; export * from "./commands/DescribeRefreshSchemasStatusCommand"; export * from "./commands/DescribeReplicationInstancesCommand"; +export * from "./pagination/DescribeReplicationInstancesPaginator"; export * from "./commands/DescribeReplicationInstanceTaskLogsCommand"; +export * from "./pagination/DescribeReplicationInstanceTaskLogsPaginator"; export * from "./commands/DescribeReplicationSubnetGroupsCommand"; +export * from "./pagination/DescribeReplicationSubnetGroupsPaginator"; export * from "./commands/DescribeReplicationTaskAssessmentResultsCommand"; +export * from "./pagination/DescribeReplicationTaskAssessmentResultsPaginator"; export * from "./commands/DescribeReplicationTaskAssessmentRunsCommand"; +export * from "./pagination/DescribeReplicationTaskAssessmentRunsPaginator"; export * from "./commands/DescribeReplicationTaskIndividualAssessmentsCommand"; +export * from "./pagination/DescribeReplicationTaskIndividualAssessmentsPaginator"; export * from "./commands/DescribeReplicationTasksCommand"; +export * from "./pagination/DescribeReplicationTasksPaginator"; export * from "./commands/DescribeSchemasCommand"; +export * from "./pagination/DescribeSchemasPaginator"; export * from "./commands/DescribeTableStatisticsCommand"; +export * from "./pagination/DescribeTableStatisticsPaginator"; export * from "./commands/ImportCertificateCommand"; export * from "./commands/ListTagsForResourceCommand"; export * from "./commands/ModifyEndpointCommand"; @@ -53,4 +71,5 @@ export * from "./commands/StartReplicationTaskAssessmentCommand"; export * from "./commands/StartReplicationTaskAssessmentRunCommand"; export * from "./commands/StopReplicationTaskCommand"; export * from "./commands/TestConnectionCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-database-migration-service/pagination/DescribeApplicableIndividualAssessmentsPaginator.ts b/clients/client-database-migration-service/pagination/DescribeApplicableIndividualAssessmentsPaginator.ts new file mode 100644 index 0000000000000..22ce90012a449 --- /dev/null +++ b/clients/client-database-migration-service/pagination/DescribeApplicableIndividualAssessmentsPaginator.ts @@ -0,0 +1,51 @@ +import { DatabaseMigrationService } from "../DatabaseMigrationService"; +import { DatabaseMigrationServiceClient } from "../DatabaseMigrationServiceClient"; +import { + DescribeApplicableIndividualAssessmentsCommand, + DescribeApplicableIndividualAssessmentsCommandInput, + DescribeApplicableIndividualAssessmentsCommandOutput, +} from "../commands/DescribeApplicableIndividualAssessmentsCommand"; +import { DatabaseMigrationServicePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DatabaseMigrationServiceClient, + input: DescribeApplicableIndividualAssessmentsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeApplicableIndividualAssessmentsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DatabaseMigrationService, + input: DescribeApplicableIndividualAssessmentsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeApplicableIndividualAssessments(input, ...args); +}; +export async function* describeApplicableIndividualAssessmentsPaginate( + config: DatabaseMigrationServicePaginationConfiguration, + input: DescribeApplicableIndividualAssessmentsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeApplicableIndividualAssessmentsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof DatabaseMigrationService) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DatabaseMigrationServiceClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DatabaseMigrationService | DatabaseMigrationServiceClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-database-migration-service/pagination/DescribeCertificatesPaginator.ts b/clients/client-database-migration-service/pagination/DescribeCertificatesPaginator.ts new file mode 100644 index 0000000000000..d5fcc6b504880 --- /dev/null +++ b/clients/client-database-migration-service/pagination/DescribeCertificatesPaginator.ts @@ -0,0 +1,51 @@ +import { DatabaseMigrationService } from "../DatabaseMigrationService"; +import { DatabaseMigrationServiceClient } from "../DatabaseMigrationServiceClient"; +import { + DescribeCertificatesCommand, + DescribeCertificatesCommandInput, + DescribeCertificatesCommandOutput, +} from "../commands/DescribeCertificatesCommand"; +import { DatabaseMigrationServicePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DatabaseMigrationServiceClient, + input: DescribeCertificatesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeCertificatesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DatabaseMigrationService, + input: DescribeCertificatesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeCertificates(input, ...args); +}; +export async function* describeCertificatesPaginate( + config: DatabaseMigrationServicePaginationConfiguration, + input: DescribeCertificatesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeCertificatesCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof DatabaseMigrationService) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DatabaseMigrationServiceClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DatabaseMigrationService | DatabaseMigrationServiceClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-database-migration-service/pagination/DescribeConnectionsPaginator.ts b/clients/client-database-migration-service/pagination/DescribeConnectionsPaginator.ts new file mode 100644 index 0000000000000..22d29f4a1d607 --- /dev/null +++ b/clients/client-database-migration-service/pagination/DescribeConnectionsPaginator.ts @@ -0,0 +1,51 @@ +import { DatabaseMigrationService } from "../DatabaseMigrationService"; +import { DatabaseMigrationServiceClient } from "../DatabaseMigrationServiceClient"; +import { + DescribeConnectionsCommand, + DescribeConnectionsCommandInput, + DescribeConnectionsCommandOutput, +} from "../commands/DescribeConnectionsCommand"; +import { DatabaseMigrationServicePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DatabaseMigrationServiceClient, + input: DescribeConnectionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeConnectionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DatabaseMigrationService, + input: DescribeConnectionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeConnections(input, ...args); +}; +export async function* describeConnectionsPaginate( + config: DatabaseMigrationServicePaginationConfiguration, + input: DescribeConnectionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeConnectionsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof DatabaseMigrationService) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DatabaseMigrationServiceClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DatabaseMigrationService | DatabaseMigrationServiceClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-database-migration-service/pagination/DescribeEndpointTypesPaginator.ts b/clients/client-database-migration-service/pagination/DescribeEndpointTypesPaginator.ts new file mode 100644 index 0000000000000..2e4a864e40f51 --- /dev/null +++ b/clients/client-database-migration-service/pagination/DescribeEndpointTypesPaginator.ts @@ -0,0 +1,51 @@ +import { DatabaseMigrationService } from "../DatabaseMigrationService"; +import { DatabaseMigrationServiceClient } from "../DatabaseMigrationServiceClient"; +import { + DescribeEndpointTypesCommand, + DescribeEndpointTypesCommandInput, + DescribeEndpointTypesCommandOutput, +} from "../commands/DescribeEndpointTypesCommand"; +import { DatabaseMigrationServicePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DatabaseMigrationServiceClient, + input: DescribeEndpointTypesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeEndpointTypesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DatabaseMigrationService, + input: DescribeEndpointTypesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeEndpointTypes(input, ...args); +}; +export async function* describeEndpointTypesPaginate( + config: DatabaseMigrationServicePaginationConfiguration, + input: DescribeEndpointTypesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeEndpointTypesCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof DatabaseMigrationService) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DatabaseMigrationServiceClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DatabaseMigrationService | DatabaseMigrationServiceClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-database-migration-service/pagination/DescribeEndpointsPaginator.ts b/clients/client-database-migration-service/pagination/DescribeEndpointsPaginator.ts new file mode 100644 index 0000000000000..5d2d8fff4abd5 --- /dev/null +++ b/clients/client-database-migration-service/pagination/DescribeEndpointsPaginator.ts @@ -0,0 +1,51 @@ +import { DatabaseMigrationService } from "../DatabaseMigrationService"; +import { DatabaseMigrationServiceClient } from "../DatabaseMigrationServiceClient"; +import { + DescribeEndpointsCommand, + DescribeEndpointsCommandInput, + DescribeEndpointsCommandOutput, +} from "../commands/DescribeEndpointsCommand"; +import { DatabaseMigrationServicePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DatabaseMigrationServiceClient, + input: DescribeEndpointsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeEndpointsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DatabaseMigrationService, + input: DescribeEndpointsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeEndpoints(input, ...args); +}; +export async function* describeEndpointsPaginate( + config: DatabaseMigrationServicePaginationConfiguration, + input: DescribeEndpointsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeEndpointsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof DatabaseMigrationService) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DatabaseMigrationServiceClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DatabaseMigrationService | DatabaseMigrationServiceClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-database-migration-service/pagination/DescribeEventSubscriptionsPaginator.ts b/clients/client-database-migration-service/pagination/DescribeEventSubscriptionsPaginator.ts new file mode 100644 index 0000000000000..4964df93d3d3d --- /dev/null +++ b/clients/client-database-migration-service/pagination/DescribeEventSubscriptionsPaginator.ts @@ -0,0 +1,51 @@ +import { DatabaseMigrationService } from "../DatabaseMigrationService"; +import { DatabaseMigrationServiceClient } from "../DatabaseMigrationServiceClient"; +import { + DescribeEventSubscriptionsCommand, + DescribeEventSubscriptionsCommandInput, + DescribeEventSubscriptionsCommandOutput, +} from "../commands/DescribeEventSubscriptionsCommand"; +import { DatabaseMigrationServicePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DatabaseMigrationServiceClient, + input: DescribeEventSubscriptionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeEventSubscriptionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DatabaseMigrationService, + input: DescribeEventSubscriptionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeEventSubscriptions(input, ...args); +}; +export async function* describeEventSubscriptionsPaginate( + config: DatabaseMigrationServicePaginationConfiguration, + input: DescribeEventSubscriptionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeEventSubscriptionsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof DatabaseMigrationService) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DatabaseMigrationServiceClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DatabaseMigrationService | DatabaseMigrationServiceClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-database-migration-service/pagination/DescribeEventsPaginator.ts b/clients/client-database-migration-service/pagination/DescribeEventsPaginator.ts new file mode 100644 index 0000000000000..6c20ba6f7aba4 --- /dev/null +++ b/clients/client-database-migration-service/pagination/DescribeEventsPaginator.ts @@ -0,0 +1,51 @@ +import { DatabaseMigrationService } from "../DatabaseMigrationService"; +import { DatabaseMigrationServiceClient } from "../DatabaseMigrationServiceClient"; +import { + DescribeEventsCommand, + DescribeEventsCommandInput, + DescribeEventsCommandOutput, +} from "../commands/DescribeEventsCommand"; +import { DatabaseMigrationServicePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DatabaseMigrationServiceClient, + input: DescribeEventsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeEventsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DatabaseMigrationService, + input: DescribeEventsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeEvents(input, ...args); +}; +export async function* describeEventsPaginate( + config: DatabaseMigrationServicePaginationConfiguration, + input: DescribeEventsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeEventsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof DatabaseMigrationService) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DatabaseMigrationServiceClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DatabaseMigrationService | DatabaseMigrationServiceClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-database-migration-service/pagination/DescribeOrderableReplicationInstancesPaginator.ts b/clients/client-database-migration-service/pagination/DescribeOrderableReplicationInstancesPaginator.ts new file mode 100644 index 0000000000000..4f8709bfa0648 --- /dev/null +++ b/clients/client-database-migration-service/pagination/DescribeOrderableReplicationInstancesPaginator.ts @@ -0,0 +1,51 @@ +import { DatabaseMigrationService } from "../DatabaseMigrationService"; +import { DatabaseMigrationServiceClient } from "../DatabaseMigrationServiceClient"; +import { + DescribeOrderableReplicationInstancesCommand, + DescribeOrderableReplicationInstancesCommandInput, + DescribeOrderableReplicationInstancesCommandOutput, +} from "../commands/DescribeOrderableReplicationInstancesCommand"; +import { DatabaseMigrationServicePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DatabaseMigrationServiceClient, + input: DescribeOrderableReplicationInstancesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeOrderableReplicationInstancesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DatabaseMigrationService, + input: DescribeOrderableReplicationInstancesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeOrderableReplicationInstances(input, ...args); +}; +export async function* describeOrderableReplicationInstancesPaginate( + config: DatabaseMigrationServicePaginationConfiguration, + input: DescribeOrderableReplicationInstancesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeOrderableReplicationInstancesCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof DatabaseMigrationService) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DatabaseMigrationServiceClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DatabaseMigrationService | DatabaseMigrationServiceClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-database-migration-service/pagination/DescribePendingMaintenanceActionsPaginator.ts b/clients/client-database-migration-service/pagination/DescribePendingMaintenanceActionsPaginator.ts new file mode 100644 index 0000000000000..69db2b7470e15 --- /dev/null +++ b/clients/client-database-migration-service/pagination/DescribePendingMaintenanceActionsPaginator.ts @@ -0,0 +1,51 @@ +import { DatabaseMigrationService } from "../DatabaseMigrationService"; +import { DatabaseMigrationServiceClient } from "../DatabaseMigrationServiceClient"; +import { + DescribePendingMaintenanceActionsCommand, + DescribePendingMaintenanceActionsCommandInput, + DescribePendingMaintenanceActionsCommandOutput, +} from "../commands/DescribePendingMaintenanceActionsCommand"; +import { DatabaseMigrationServicePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DatabaseMigrationServiceClient, + input: DescribePendingMaintenanceActionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribePendingMaintenanceActionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DatabaseMigrationService, + input: DescribePendingMaintenanceActionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describePendingMaintenanceActions(input, ...args); +}; +export async function* describePendingMaintenanceActionsPaginate( + config: DatabaseMigrationServicePaginationConfiguration, + input: DescribePendingMaintenanceActionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribePendingMaintenanceActionsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof DatabaseMigrationService) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DatabaseMigrationServiceClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DatabaseMigrationService | DatabaseMigrationServiceClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-database-migration-service/pagination/DescribeReplicationInstanceTaskLogsPaginator.ts b/clients/client-database-migration-service/pagination/DescribeReplicationInstanceTaskLogsPaginator.ts new file mode 100644 index 0000000000000..dea8b9dcb8d31 --- /dev/null +++ b/clients/client-database-migration-service/pagination/DescribeReplicationInstanceTaskLogsPaginator.ts @@ -0,0 +1,51 @@ +import { DatabaseMigrationService } from "../DatabaseMigrationService"; +import { DatabaseMigrationServiceClient } from "../DatabaseMigrationServiceClient"; +import { + DescribeReplicationInstanceTaskLogsCommand, + DescribeReplicationInstanceTaskLogsCommandInput, + DescribeReplicationInstanceTaskLogsCommandOutput, +} from "../commands/DescribeReplicationInstanceTaskLogsCommand"; +import { DatabaseMigrationServicePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DatabaseMigrationServiceClient, + input: DescribeReplicationInstanceTaskLogsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeReplicationInstanceTaskLogsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DatabaseMigrationService, + input: DescribeReplicationInstanceTaskLogsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeReplicationInstanceTaskLogs(input, ...args); +}; +export async function* describeReplicationInstanceTaskLogsPaginate( + config: DatabaseMigrationServicePaginationConfiguration, + input: DescribeReplicationInstanceTaskLogsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeReplicationInstanceTaskLogsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof DatabaseMigrationService) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DatabaseMigrationServiceClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DatabaseMigrationService | DatabaseMigrationServiceClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-database-migration-service/pagination/DescribeReplicationInstancesPaginator.ts b/clients/client-database-migration-service/pagination/DescribeReplicationInstancesPaginator.ts new file mode 100644 index 0000000000000..6e5abcd48a27d --- /dev/null +++ b/clients/client-database-migration-service/pagination/DescribeReplicationInstancesPaginator.ts @@ -0,0 +1,51 @@ +import { DatabaseMigrationService } from "../DatabaseMigrationService"; +import { DatabaseMigrationServiceClient } from "../DatabaseMigrationServiceClient"; +import { + DescribeReplicationInstancesCommand, + DescribeReplicationInstancesCommandInput, + DescribeReplicationInstancesCommandOutput, +} from "../commands/DescribeReplicationInstancesCommand"; +import { DatabaseMigrationServicePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DatabaseMigrationServiceClient, + input: DescribeReplicationInstancesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeReplicationInstancesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DatabaseMigrationService, + input: DescribeReplicationInstancesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeReplicationInstances(input, ...args); +}; +export async function* describeReplicationInstancesPaginate( + config: DatabaseMigrationServicePaginationConfiguration, + input: DescribeReplicationInstancesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeReplicationInstancesCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof DatabaseMigrationService) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DatabaseMigrationServiceClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DatabaseMigrationService | DatabaseMigrationServiceClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-database-migration-service/pagination/DescribeReplicationSubnetGroupsPaginator.ts b/clients/client-database-migration-service/pagination/DescribeReplicationSubnetGroupsPaginator.ts new file mode 100644 index 0000000000000..f2b2d674d7229 --- /dev/null +++ b/clients/client-database-migration-service/pagination/DescribeReplicationSubnetGroupsPaginator.ts @@ -0,0 +1,51 @@ +import { DatabaseMigrationService } from "../DatabaseMigrationService"; +import { DatabaseMigrationServiceClient } from "../DatabaseMigrationServiceClient"; +import { + DescribeReplicationSubnetGroupsCommand, + DescribeReplicationSubnetGroupsCommandInput, + DescribeReplicationSubnetGroupsCommandOutput, +} from "../commands/DescribeReplicationSubnetGroupsCommand"; +import { DatabaseMigrationServicePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DatabaseMigrationServiceClient, + input: DescribeReplicationSubnetGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeReplicationSubnetGroupsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DatabaseMigrationService, + input: DescribeReplicationSubnetGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeReplicationSubnetGroups(input, ...args); +}; +export async function* describeReplicationSubnetGroupsPaginate( + config: DatabaseMigrationServicePaginationConfiguration, + input: DescribeReplicationSubnetGroupsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeReplicationSubnetGroupsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof DatabaseMigrationService) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DatabaseMigrationServiceClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DatabaseMigrationService | DatabaseMigrationServiceClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-database-migration-service/pagination/DescribeReplicationTaskAssessmentResultsPaginator.ts b/clients/client-database-migration-service/pagination/DescribeReplicationTaskAssessmentResultsPaginator.ts new file mode 100644 index 0000000000000..d722ccee3144b --- /dev/null +++ b/clients/client-database-migration-service/pagination/DescribeReplicationTaskAssessmentResultsPaginator.ts @@ -0,0 +1,51 @@ +import { DatabaseMigrationService } from "../DatabaseMigrationService"; +import { DatabaseMigrationServiceClient } from "../DatabaseMigrationServiceClient"; +import { + DescribeReplicationTaskAssessmentResultsCommand, + DescribeReplicationTaskAssessmentResultsCommandInput, + DescribeReplicationTaskAssessmentResultsCommandOutput, +} from "../commands/DescribeReplicationTaskAssessmentResultsCommand"; +import { DatabaseMigrationServicePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DatabaseMigrationServiceClient, + input: DescribeReplicationTaskAssessmentResultsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeReplicationTaskAssessmentResultsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DatabaseMigrationService, + input: DescribeReplicationTaskAssessmentResultsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeReplicationTaskAssessmentResults(input, ...args); +}; +export async function* describeReplicationTaskAssessmentResultsPaginate( + config: DatabaseMigrationServicePaginationConfiguration, + input: DescribeReplicationTaskAssessmentResultsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeReplicationTaskAssessmentResultsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof DatabaseMigrationService) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DatabaseMigrationServiceClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DatabaseMigrationService | DatabaseMigrationServiceClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-database-migration-service/pagination/DescribeReplicationTaskAssessmentRunsPaginator.ts b/clients/client-database-migration-service/pagination/DescribeReplicationTaskAssessmentRunsPaginator.ts new file mode 100644 index 0000000000000..a4ec6ed10e098 --- /dev/null +++ b/clients/client-database-migration-service/pagination/DescribeReplicationTaskAssessmentRunsPaginator.ts @@ -0,0 +1,51 @@ +import { DatabaseMigrationService } from "../DatabaseMigrationService"; +import { DatabaseMigrationServiceClient } from "../DatabaseMigrationServiceClient"; +import { + DescribeReplicationTaskAssessmentRunsCommand, + DescribeReplicationTaskAssessmentRunsCommandInput, + DescribeReplicationTaskAssessmentRunsCommandOutput, +} from "../commands/DescribeReplicationTaskAssessmentRunsCommand"; +import { DatabaseMigrationServicePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DatabaseMigrationServiceClient, + input: DescribeReplicationTaskAssessmentRunsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeReplicationTaskAssessmentRunsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DatabaseMigrationService, + input: DescribeReplicationTaskAssessmentRunsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeReplicationTaskAssessmentRuns(input, ...args); +}; +export async function* describeReplicationTaskAssessmentRunsPaginate( + config: DatabaseMigrationServicePaginationConfiguration, + input: DescribeReplicationTaskAssessmentRunsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeReplicationTaskAssessmentRunsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof DatabaseMigrationService) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DatabaseMigrationServiceClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DatabaseMigrationService | DatabaseMigrationServiceClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-database-migration-service/pagination/DescribeReplicationTaskIndividualAssessmentsPaginator.ts b/clients/client-database-migration-service/pagination/DescribeReplicationTaskIndividualAssessmentsPaginator.ts new file mode 100644 index 0000000000000..d855f022d3fe1 --- /dev/null +++ b/clients/client-database-migration-service/pagination/DescribeReplicationTaskIndividualAssessmentsPaginator.ts @@ -0,0 +1,51 @@ +import { DatabaseMigrationService } from "../DatabaseMigrationService"; +import { DatabaseMigrationServiceClient } from "../DatabaseMigrationServiceClient"; +import { + DescribeReplicationTaskIndividualAssessmentsCommand, + DescribeReplicationTaskIndividualAssessmentsCommandInput, + DescribeReplicationTaskIndividualAssessmentsCommandOutput, +} from "../commands/DescribeReplicationTaskIndividualAssessmentsCommand"; +import { DatabaseMigrationServicePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DatabaseMigrationServiceClient, + input: DescribeReplicationTaskIndividualAssessmentsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeReplicationTaskIndividualAssessmentsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DatabaseMigrationService, + input: DescribeReplicationTaskIndividualAssessmentsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeReplicationTaskIndividualAssessments(input, ...args); +}; +export async function* describeReplicationTaskIndividualAssessmentsPaginate( + config: DatabaseMigrationServicePaginationConfiguration, + input: DescribeReplicationTaskIndividualAssessmentsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeReplicationTaskIndividualAssessmentsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof DatabaseMigrationService) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DatabaseMigrationServiceClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DatabaseMigrationService | DatabaseMigrationServiceClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-database-migration-service/pagination/DescribeReplicationTasksPaginator.ts b/clients/client-database-migration-service/pagination/DescribeReplicationTasksPaginator.ts new file mode 100644 index 0000000000000..52d6d40ae060a --- /dev/null +++ b/clients/client-database-migration-service/pagination/DescribeReplicationTasksPaginator.ts @@ -0,0 +1,51 @@ +import { DatabaseMigrationService } from "../DatabaseMigrationService"; +import { DatabaseMigrationServiceClient } from "../DatabaseMigrationServiceClient"; +import { + DescribeReplicationTasksCommand, + DescribeReplicationTasksCommandInput, + DescribeReplicationTasksCommandOutput, +} from "../commands/DescribeReplicationTasksCommand"; +import { DatabaseMigrationServicePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DatabaseMigrationServiceClient, + input: DescribeReplicationTasksCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeReplicationTasksCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DatabaseMigrationService, + input: DescribeReplicationTasksCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeReplicationTasks(input, ...args); +}; +export async function* describeReplicationTasksPaginate( + config: DatabaseMigrationServicePaginationConfiguration, + input: DescribeReplicationTasksCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeReplicationTasksCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof DatabaseMigrationService) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DatabaseMigrationServiceClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DatabaseMigrationService | DatabaseMigrationServiceClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-database-migration-service/pagination/DescribeSchemasPaginator.ts b/clients/client-database-migration-service/pagination/DescribeSchemasPaginator.ts new file mode 100644 index 0000000000000..f3c71bcce4a49 --- /dev/null +++ b/clients/client-database-migration-service/pagination/DescribeSchemasPaginator.ts @@ -0,0 +1,51 @@ +import { DatabaseMigrationService } from "../DatabaseMigrationService"; +import { DatabaseMigrationServiceClient } from "../DatabaseMigrationServiceClient"; +import { + DescribeSchemasCommand, + DescribeSchemasCommandInput, + DescribeSchemasCommandOutput, +} from "../commands/DescribeSchemasCommand"; +import { DatabaseMigrationServicePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DatabaseMigrationServiceClient, + input: DescribeSchemasCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeSchemasCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DatabaseMigrationService, + input: DescribeSchemasCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeSchemas(input, ...args); +}; +export async function* describeSchemasPaginate( + config: DatabaseMigrationServicePaginationConfiguration, + input: DescribeSchemasCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeSchemasCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof DatabaseMigrationService) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DatabaseMigrationServiceClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DatabaseMigrationService | DatabaseMigrationServiceClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-database-migration-service/pagination/DescribeTableStatisticsPaginator.ts b/clients/client-database-migration-service/pagination/DescribeTableStatisticsPaginator.ts new file mode 100644 index 0000000000000..af52750a84035 --- /dev/null +++ b/clients/client-database-migration-service/pagination/DescribeTableStatisticsPaginator.ts @@ -0,0 +1,51 @@ +import { DatabaseMigrationService } from "../DatabaseMigrationService"; +import { DatabaseMigrationServiceClient } from "../DatabaseMigrationServiceClient"; +import { + DescribeTableStatisticsCommand, + DescribeTableStatisticsCommandInput, + DescribeTableStatisticsCommandOutput, +} from "../commands/DescribeTableStatisticsCommand"; +import { DatabaseMigrationServicePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DatabaseMigrationServiceClient, + input: DescribeTableStatisticsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeTableStatisticsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DatabaseMigrationService, + input: DescribeTableStatisticsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeTableStatistics(input, ...args); +}; +export async function* describeTableStatisticsPaginate( + config: DatabaseMigrationServicePaginationConfiguration, + input: DescribeTableStatisticsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeTableStatisticsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof DatabaseMigrationService) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DatabaseMigrationServiceClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DatabaseMigrationService | DatabaseMigrationServiceClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-database-migration-service/pagination/Interfaces.ts b/clients/client-database-migration-service/pagination/Interfaces.ts new file mode 100644 index 0000000000000..c411fa46ac3c1 --- /dev/null +++ b/clients/client-database-migration-service/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { DatabaseMigrationService } from "../DatabaseMigrationService"; +import { DatabaseMigrationServiceClient } from "../DatabaseMigrationServiceClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface DatabaseMigrationServicePaginationConfiguration extends PaginationConfiguration { + client: DatabaseMigrationService | DatabaseMigrationServiceClient; +} diff --git a/clients/client-datasync/index.ts b/clients/client-datasync/index.ts index 65fbc2366319d..c8b87852935ec 100644 --- a/clients/client-datasync/index.ts +++ b/clients/client-datasync/index.ts @@ -22,13 +22,19 @@ export * from "./commands/DescribeLocationSmbCommand"; export * from "./commands/DescribeTaskCommand"; export * from "./commands/DescribeTaskExecutionCommand"; export * from "./commands/ListAgentsCommand"; +export * from "./pagination/ListAgentsPaginator"; export * from "./commands/ListLocationsCommand"; +export * from "./pagination/ListLocationsPaginator"; export * from "./commands/ListTagsForResourceCommand"; +export * from "./pagination/ListTagsForResourcePaginator"; export * from "./commands/ListTaskExecutionsCommand"; +export * from "./pagination/ListTaskExecutionsPaginator"; export * from "./commands/ListTasksCommand"; +export * from "./pagination/ListTasksPaginator"; export * from "./commands/StartTaskExecutionCommand"; export * from "./commands/TagResourceCommand"; export * from "./commands/UntagResourceCommand"; export * from "./commands/UpdateAgentCommand"; export * from "./commands/UpdateTaskCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-datasync/pagination/Interfaces.ts b/clients/client-datasync/pagination/Interfaces.ts new file mode 100644 index 0000000000000..e3fb3db068867 --- /dev/null +++ b/clients/client-datasync/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { DataSync } from "../DataSync"; +import { DataSyncClient } from "../DataSyncClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface DataSyncPaginationConfiguration extends PaginationConfiguration { + client: DataSync | DataSyncClient; +} diff --git a/clients/client-datasync/pagination/ListAgentsPaginator.ts b/clients/client-datasync/pagination/ListAgentsPaginator.ts new file mode 100644 index 0000000000000..a13ab09a6e525 --- /dev/null +++ b/clients/client-datasync/pagination/ListAgentsPaginator.ts @@ -0,0 +1,47 @@ +import { DataSync } from "../DataSync"; +import { DataSyncClient } from "../DataSyncClient"; +import { ListAgentsCommand, ListAgentsCommandInput, ListAgentsCommandOutput } from "../commands/ListAgentsCommand"; +import { DataSyncPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DataSyncClient, + input: ListAgentsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListAgentsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DataSync, + input: ListAgentsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listAgents(input, ...args); +}; +export async function* listAgentsPaginate( + config: DataSyncPaginationConfiguration, + input: ListAgentsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListAgentsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof DataSync) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DataSyncClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DataSync | DataSyncClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-datasync/pagination/ListLocationsPaginator.ts b/clients/client-datasync/pagination/ListLocationsPaginator.ts new file mode 100644 index 0000000000000..e32b3066d6a3c --- /dev/null +++ b/clients/client-datasync/pagination/ListLocationsPaginator.ts @@ -0,0 +1,51 @@ +import { DataSync } from "../DataSync"; +import { DataSyncClient } from "../DataSyncClient"; +import { + ListLocationsCommand, + ListLocationsCommandInput, + ListLocationsCommandOutput, +} from "../commands/ListLocationsCommand"; +import { DataSyncPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DataSyncClient, + input: ListLocationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListLocationsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DataSync, + input: ListLocationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listLocations(input, ...args); +}; +export async function* listLocationsPaginate( + config: DataSyncPaginationConfiguration, + input: ListLocationsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListLocationsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof DataSync) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DataSyncClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DataSync | DataSyncClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-datasync/pagination/ListTagsForResourcePaginator.ts b/clients/client-datasync/pagination/ListTagsForResourcePaginator.ts new file mode 100644 index 0000000000000..6a1b49a892a51 --- /dev/null +++ b/clients/client-datasync/pagination/ListTagsForResourcePaginator.ts @@ -0,0 +1,51 @@ +import { DataSync } from "../DataSync"; +import { DataSyncClient } from "../DataSyncClient"; +import { + ListTagsForResourceCommand, + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput, +} from "../commands/ListTagsForResourceCommand"; +import { DataSyncPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DataSyncClient, + input: ListTagsForResourceCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTagsForResourceCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DataSync, + input: ListTagsForResourceCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTagsForResource(input, ...args); +}; +export async function* listTagsForResourcePaginate( + config: DataSyncPaginationConfiguration, + input: ListTagsForResourceCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTagsForResourceCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof DataSync) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DataSyncClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DataSync | DataSyncClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-datasync/pagination/ListTaskExecutionsPaginator.ts b/clients/client-datasync/pagination/ListTaskExecutionsPaginator.ts new file mode 100644 index 0000000000000..be1799072700d --- /dev/null +++ b/clients/client-datasync/pagination/ListTaskExecutionsPaginator.ts @@ -0,0 +1,51 @@ +import { DataSync } from "../DataSync"; +import { DataSyncClient } from "../DataSyncClient"; +import { + ListTaskExecutionsCommand, + ListTaskExecutionsCommandInput, + ListTaskExecutionsCommandOutput, +} from "../commands/ListTaskExecutionsCommand"; +import { DataSyncPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DataSyncClient, + input: ListTaskExecutionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTaskExecutionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DataSync, + input: ListTaskExecutionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTaskExecutions(input, ...args); +}; +export async function* listTaskExecutionsPaginate( + config: DataSyncPaginationConfiguration, + input: ListTaskExecutionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTaskExecutionsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof DataSync) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DataSyncClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DataSync | DataSyncClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-datasync/pagination/ListTasksPaginator.ts b/clients/client-datasync/pagination/ListTasksPaginator.ts new file mode 100644 index 0000000000000..05b43e925ff1f --- /dev/null +++ b/clients/client-datasync/pagination/ListTasksPaginator.ts @@ -0,0 +1,47 @@ +import { DataSync } from "../DataSync"; +import { DataSyncClient } from "../DataSyncClient"; +import { ListTasksCommand, ListTasksCommandInput, ListTasksCommandOutput } from "../commands/ListTasksCommand"; +import { DataSyncPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DataSyncClient, + input: ListTasksCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTasksCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DataSync, + input: ListTasksCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTasks(input, ...args); +}; +export async function* listTasksPaginate( + config: DataSyncPaginationConfiguration, + input: ListTasksCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTasksCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof DataSync) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DataSyncClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DataSync | DataSyncClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-detective/index.ts b/clients/client-detective/index.ts index e65d0fe257b1c..da0e5e72e5561 100644 --- a/clients/client-detective/index.ts +++ b/clients/client-detective/index.ts @@ -8,8 +8,12 @@ export * from "./commands/DeleteMembersCommand"; export * from "./commands/DisassociateMembershipCommand"; export * from "./commands/GetMembersCommand"; export * from "./commands/ListGraphsCommand"; +export * from "./pagination/ListGraphsPaginator"; export * from "./commands/ListInvitationsCommand"; +export * from "./pagination/ListInvitationsPaginator"; export * from "./commands/ListMembersCommand"; +export * from "./pagination/ListMembersPaginator"; export * from "./commands/RejectInvitationCommand"; export * from "./commands/StartMonitoringMemberCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-detective/pagination/Interfaces.ts b/clients/client-detective/pagination/Interfaces.ts new file mode 100644 index 0000000000000..d838aa70e4a54 --- /dev/null +++ b/clients/client-detective/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { Detective } from "../Detective"; +import { DetectiveClient } from "../DetectiveClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface DetectivePaginationConfiguration extends PaginationConfiguration { + client: Detective | DetectiveClient; +} diff --git a/clients/client-detective/pagination/ListGraphsPaginator.ts b/clients/client-detective/pagination/ListGraphsPaginator.ts new file mode 100644 index 0000000000000..bb83e49173a16 --- /dev/null +++ b/clients/client-detective/pagination/ListGraphsPaginator.ts @@ -0,0 +1,47 @@ +import { Detective } from "../Detective"; +import { DetectiveClient } from "../DetectiveClient"; +import { ListGraphsCommand, ListGraphsCommandInput, ListGraphsCommandOutput } from "../commands/ListGraphsCommand"; +import { DetectivePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DetectiveClient, + input: ListGraphsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListGraphsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Detective, + input: ListGraphsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listGraphs(input, ...args); +}; +export async function* listGraphsPaginate( + config: DetectivePaginationConfiguration, + input: ListGraphsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListGraphsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Detective) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DetectiveClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Detective | DetectiveClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-detective/pagination/ListInvitationsPaginator.ts b/clients/client-detective/pagination/ListInvitationsPaginator.ts new file mode 100644 index 0000000000000..bf6b41ecaa977 --- /dev/null +++ b/clients/client-detective/pagination/ListInvitationsPaginator.ts @@ -0,0 +1,51 @@ +import { Detective } from "../Detective"; +import { DetectiveClient } from "../DetectiveClient"; +import { + ListInvitationsCommand, + ListInvitationsCommandInput, + ListInvitationsCommandOutput, +} from "../commands/ListInvitationsCommand"; +import { DetectivePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DetectiveClient, + input: ListInvitationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListInvitationsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Detective, + input: ListInvitationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listInvitations(input, ...args); +}; +export async function* listInvitationsPaginate( + config: DetectivePaginationConfiguration, + input: ListInvitationsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListInvitationsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Detective) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DetectiveClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Detective | DetectiveClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-detective/pagination/ListMembersPaginator.ts b/clients/client-detective/pagination/ListMembersPaginator.ts new file mode 100644 index 0000000000000..5950b820512e4 --- /dev/null +++ b/clients/client-detective/pagination/ListMembersPaginator.ts @@ -0,0 +1,47 @@ +import { Detective } from "../Detective"; +import { DetectiveClient } from "../DetectiveClient"; +import { ListMembersCommand, ListMembersCommandInput, ListMembersCommandOutput } from "../commands/ListMembersCommand"; +import { DetectivePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DetectiveClient, + input: ListMembersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListMembersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Detective, + input: ListMembersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listMembers(input, ...args); +}; +export async function* listMembersPaginate( + config: DetectivePaginationConfiguration, + input: ListMembersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListMembersCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Detective) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DetectiveClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Detective | DetectiveClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-device-farm/index.ts b/clients/client-device-farm/index.ts index 2df3d5c1eca8f..3e082294ac511 100644 --- a/clients/client-device-farm/index.ts +++ b/clients/client-device-farm/index.ts @@ -27,6 +27,7 @@ export * from "./commands/GetInstanceProfileCommand"; export * from "./commands/GetJobCommand"; export * from "./commands/GetNetworkProfileCommand"; export * from "./commands/GetOfferingStatusCommand"; +export * from "./pagination/GetOfferingStatusPaginator"; export * from "./commands/GetProjectCommand"; export * from "./commands/GetRemoteAccessSessionCommand"; export * from "./commands/GetRunCommand"; @@ -38,28 +39,45 @@ export * from "./commands/GetUploadCommand"; export * from "./commands/GetVPCEConfigurationCommand"; export * from "./commands/InstallToRemoteAccessSessionCommand"; export * from "./commands/ListArtifactsCommand"; +export * from "./pagination/ListArtifactsPaginator"; export * from "./commands/ListDeviceInstancesCommand"; export * from "./commands/ListDevicePoolsCommand"; +export * from "./pagination/ListDevicePoolsPaginator"; export * from "./commands/ListDevicesCommand"; +export * from "./pagination/ListDevicesPaginator"; export * from "./commands/ListInstanceProfilesCommand"; export * from "./commands/ListJobsCommand"; +export * from "./pagination/ListJobsPaginator"; export * from "./commands/ListNetworkProfilesCommand"; export * from "./commands/ListOfferingPromotionsCommand"; export * from "./commands/ListOfferingsCommand"; +export * from "./pagination/ListOfferingsPaginator"; export * from "./commands/ListOfferingTransactionsCommand"; +export * from "./pagination/ListOfferingTransactionsPaginator"; export * from "./commands/ListProjectsCommand"; +export * from "./pagination/ListProjectsPaginator"; export * from "./commands/ListRemoteAccessSessionsCommand"; export * from "./commands/ListRunsCommand"; +export * from "./pagination/ListRunsPaginator"; export * from "./commands/ListSamplesCommand"; +export * from "./pagination/ListSamplesPaginator"; export * from "./commands/ListSuitesCommand"; +export * from "./pagination/ListSuitesPaginator"; export * from "./commands/ListTagsForResourceCommand"; export * from "./commands/ListTestGridProjectsCommand"; +export * from "./pagination/ListTestGridProjectsPaginator"; export * from "./commands/ListTestGridSessionActionsCommand"; +export * from "./pagination/ListTestGridSessionActionsPaginator"; export * from "./commands/ListTestGridSessionArtifactsCommand"; +export * from "./pagination/ListTestGridSessionArtifactsPaginator"; export * from "./commands/ListTestGridSessionsCommand"; +export * from "./pagination/ListTestGridSessionsPaginator"; export * from "./commands/ListTestsCommand"; +export * from "./pagination/ListTestsPaginator"; export * from "./commands/ListUniqueProblemsCommand"; +export * from "./pagination/ListUniqueProblemsPaginator"; export * from "./commands/ListUploadsCommand"; +export * from "./pagination/ListUploadsPaginator"; export * from "./commands/ListVPCEConfigurationsCommand"; export * from "./commands/PurchaseOfferingCommand"; export * from "./commands/RenewOfferingCommand"; @@ -77,4 +95,5 @@ export * from "./commands/UpdateProjectCommand"; export * from "./commands/UpdateTestGridProjectCommand"; export * from "./commands/UpdateUploadCommand"; export * from "./commands/UpdateVPCEConfigurationCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-device-farm/pagination/GetOfferingStatusPaginator.ts b/clients/client-device-farm/pagination/GetOfferingStatusPaginator.ts new file mode 100644 index 0000000000000..ab41ca4b99fe0 --- /dev/null +++ b/clients/client-device-farm/pagination/GetOfferingStatusPaginator.ts @@ -0,0 +1,50 @@ +import { DeviceFarm } from "../DeviceFarm"; +import { DeviceFarmClient } from "../DeviceFarmClient"; +import { + GetOfferingStatusCommand, + GetOfferingStatusCommandInput, + GetOfferingStatusCommandOutput, +} from "../commands/GetOfferingStatusCommand"; +import { DeviceFarmPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DeviceFarmClient, + input: GetOfferingStatusCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetOfferingStatusCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DeviceFarm, + input: GetOfferingStatusCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getOfferingStatus(input, ...args); +}; +export async function* getOfferingStatusPaginate( + config: DeviceFarmPaginationConfiguration, + input: GetOfferingStatusCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetOfferingStatusCommandOutput; + while (hasNext) { + input["nextToken"] = token; + if (config.client instanceof DeviceFarm) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DeviceFarmClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DeviceFarm | DeviceFarmClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-device-farm/pagination/Interfaces.ts b/clients/client-device-farm/pagination/Interfaces.ts new file mode 100644 index 0000000000000..572484951ecbd --- /dev/null +++ b/clients/client-device-farm/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { DeviceFarm } from "../DeviceFarm"; +import { DeviceFarmClient } from "../DeviceFarmClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface DeviceFarmPaginationConfiguration extends PaginationConfiguration { + client: DeviceFarm | DeviceFarmClient; +} diff --git a/clients/client-device-farm/pagination/ListArtifactsPaginator.ts b/clients/client-device-farm/pagination/ListArtifactsPaginator.ts new file mode 100644 index 0000000000000..859e4a47ae131 --- /dev/null +++ b/clients/client-device-farm/pagination/ListArtifactsPaginator.ts @@ -0,0 +1,50 @@ +import { DeviceFarm } from "../DeviceFarm"; +import { DeviceFarmClient } from "../DeviceFarmClient"; +import { + ListArtifactsCommand, + ListArtifactsCommandInput, + ListArtifactsCommandOutput, +} from "../commands/ListArtifactsCommand"; +import { DeviceFarmPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DeviceFarmClient, + input: ListArtifactsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListArtifactsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DeviceFarm, + input: ListArtifactsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listArtifacts(input, ...args); +}; +export async function* listArtifactsPaginate( + config: DeviceFarmPaginationConfiguration, + input: ListArtifactsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListArtifactsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + if (config.client instanceof DeviceFarm) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DeviceFarmClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DeviceFarm | DeviceFarmClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-device-farm/pagination/ListDevicePoolsPaginator.ts b/clients/client-device-farm/pagination/ListDevicePoolsPaginator.ts new file mode 100644 index 0000000000000..5d5647c205158 --- /dev/null +++ b/clients/client-device-farm/pagination/ListDevicePoolsPaginator.ts @@ -0,0 +1,50 @@ +import { DeviceFarm } from "../DeviceFarm"; +import { DeviceFarmClient } from "../DeviceFarmClient"; +import { + ListDevicePoolsCommand, + ListDevicePoolsCommandInput, + ListDevicePoolsCommandOutput, +} from "../commands/ListDevicePoolsCommand"; +import { DeviceFarmPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DeviceFarmClient, + input: ListDevicePoolsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDevicePoolsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DeviceFarm, + input: ListDevicePoolsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDevicePools(input, ...args); +}; +export async function* listDevicePoolsPaginate( + config: DeviceFarmPaginationConfiguration, + input: ListDevicePoolsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDevicePoolsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + if (config.client instanceof DeviceFarm) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DeviceFarmClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DeviceFarm | DeviceFarmClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-device-farm/pagination/ListDevicesPaginator.ts b/clients/client-device-farm/pagination/ListDevicesPaginator.ts new file mode 100644 index 0000000000000..7760bf24f92bc --- /dev/null +++ b/clients/client-device-farm/pagination/ListDevicesPaginator.ts @@ -0,0 +1,46 @@ +import { DeviceFarm } from "../DeviceFarm"; +import { DeviceFarmClient } from "../DeviceFarmClient"; +import { ListDevicesCommand, ListDevicesCommandInput, ListDevicesCommandOutput } from "../commands/ListDevicesCommand"; +import { DeviceFarmPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DeviceFarmClient, + input: ListDevicesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDevicesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DeviceFarm, + input: ListDevicesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDevices(input, ...args); +}; +export async function* listDevicesPaginate( + config: DeviceFarmPaginationConfiguration, + input: ListDevicesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDevicesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + if (config.client instanceof DeviceFarm) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DeviceFarmClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DeviceFarm | DeviceFarmClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-device-farm/pagination/ListJobsPaginator.ts b/clients/client-device-farm/pagination/ListJobsPaginator.ts new file mode 100644 index 0000000000000..50fd45eb0f23e --- /dev/null +++ b/clients/client-device-farm/pagination/ListJobsPaginator.ts @@ -0,0 +1,46 @@ +import { DeviceFarm } from "../DeviceFarm"; +import { DeviceFarmClient } from "../DeviceFarmClient"; +import { ListJobsCommand, ListJobsCommandInput, ListJobsCommandOutput } from "../commands/ListJobsCommand"; +import { DeviceFarmPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DeviceFarmClient, + input: ListJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListJobsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DeviceFarm, + input: ListJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listJobs(input, ...args); +}; +export async function* listJobsPaginate( + config: DeviceFarmPaginationConfiguration, + input: ListJobsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListJobsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + if (config.client instanceof DeviceFarm) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DeviceFarmClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DeviceFarm | DeviceFarmClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-device-farm/pagination/ListOfferingTransactionsPaginator.ts b/clients/client-device-farm/pagination/ListOfferingTransactionsPaginator.ts new file mode 100644 index 0000000000000..bd532f71da184 --- /dev/null +++ b/clients/client-device-farm/pagination/ListOfferingTransactionsPaginator.ts @@ -0,0 +1,50 @@ +import { DeviceFarm } from "../DeviceFarm"; +import { DeviceFarmClient } from "../DeviceFarmClient"; +import { + ListOfferingTransactionsCommand, + ListOfferingTransactionsCommandInput, + ListOfferingTransactionsCommandOutput, +} from "../commands/ListOfferingTransactionsCommand"; +import { DeviceFarmPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DeviceFarmClient, + input: ListOfferingTransactionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListOfferingTransactionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DeviceFarm, + input: ListOfferingTransactionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listOfferingTransactions(input, ...args); +}; +export async function* listOfferingTransactionsPaginate( + config: DeviceFarmPaginationConfiguration, + input: ListOfferingTransactionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListOfferingTransactionsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + if (config.client instanceof DeviceFarm) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DeviceFarmClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DeviceFarm | DeviceFarmClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-device-farm/pagination/ListOfferingsPaginator.ts b/clients/client-device-farm/pagination/ListOfferingsPaginator.ts new file mode 100644 index 0000000000000..b80ad4656da71 --- /dev/null +++ b/clients/client-device-farm/pagination/ListOfferingsPaginator.ts @@ -0,0 +1,50 @@ +import { DeviceFarm } from "../DeviceFarm"; +import { DeviceFarmClient } from "../DeviceFarmClient"; +import { + ListOfferingsCommand, + ListOfferingsCommandInput, + ListOfferingsCommandOutput, +} from "../commands/ListOfferingsCommand"; +import { DeviceFarmPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DeviceFarmClient, + input: ListOfferingsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListOfferingsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DeviceFarm, + input: ListOfferingsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listOfferings(input, ...args); +}; +export async function* listOfferingsPaginate( + config: DeviceFarmPaginationConfiguration, + input: ListOfferingsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListOfferingsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + if (config.client instanceof DeviceFarm) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DeviceFarmClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DeviceFarm | DeviceFarmClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-device-farm/pagination/ListProjectsPaginator.ts b/clients/client-device-farm/pagination/ListProjectsPaginator.ts new file mode 100644 index 0000000000000..4cf1d1203bf3e --- /dev/null +++ b/clients/client-device-farm/pagination/ListProjectsPaginator.ts @@ -0,0 +1,50 @@ +import { DeviceFarm } from "../DeviceFarm"; +import { DeviceFarmClient } from "../DeviceFarmClient"; +import { + ListProjectsCommand, + ListProjectsCommandInput, + ListProjectsCommandOutput, +} from "../commands/ListProjectsCommand"; +import { DeviceFarmPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DeviceFarmClient, + input: ListProjectsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListProjectsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DeviceFarm, + input: ListProjectsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listProjects(input, ...args); +}; +export async function* listProjectsPaginate( + config: DeviceFarmPaginationConfiguration, + input: ListProjectsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListProjectsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + if (config.client instanceof DeviceFarm) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DeviceFarmClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DeviceFarm | DeviceFarmClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-device-farm/pagination/ListRunsPaginator.ts b/clients/client-device-farm/pagination/ListRunsPaginator.ts new file mode 100644 index 0000000000000..f3f5c5fab9dfb --- /dev/null +++ b/clients/client-device-farm/pagination/ListRunsPaginator.ts @@ -0,0 +1,46 @@ +import { DeviceFarm } from "../DeviceFarm"; +import { DeviceFarmClient } from "../DeviceFarmClient"; +import { ListRunsCommand, ListRunsCommandInput, ListRunsCommandOutput } from "../commands/ListRunsCommand"; +import { DeviceFarmPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DeviceFarmClient, + input: ListRunsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListRunsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DeviceFarm, + input: ListRunsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listRuns(input, ...args); +}; +export async function* listRunsPaginate( + config: DeviceFarmPaginationConfiguration, + input: ListRunsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListRunsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + if (config.client instanceof DeviceFarm) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DeviceFarmClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DeviceFarm | DeviceFarmClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-device-farm/pagination/ListSamplesPaginator.ts b/clients/client-device-farm/pagination/ListSamplesPaginator.ts new file mode 100644 index 0000000000000..07e2095dc0dc7 --- /dev/null +++ b/clients/client-device-farm/pagination/ListSamplesPaginator.ts @@ -0,0 +1,46 @@ +import { DeviceFarm } from "../DeviceFarm"; +import { DeviceFarmClient } from "../DeviceFarmClient"; +import { ListSamplesCommand, ListSamplesCommandInput, ListSamplesCommandOutput } from "../commands/ListSamplesCommand"; +import { DeviceFarmPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DeviceFarmClient, + input: ListSamplesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListSamplesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DeviceFarm, + input: ListSamplesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listSamples(input, ...args); +}; +export async function* listSamplesPaginate( + config: DeviceFarmPaginationConfiguration, + input: ListSamplesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListSamplesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + if (config.client instanceof DeviceFarm) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DeviceFarmClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DeviceFarm | DeviceFarmClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-device-farm/pagination/ListSuitesPaginator.ts b/clients/client-device-farm/pagination/ListSuitesPaginator.ts new file mode 100644 index 0000000000000..5e114330d5242 --- /dev/null +++ b/clients/client-device-farm/pagination/ListSuitesPaginator.ts @@ -0,0 +1,46 @@ +import { DeviceFarm } from "../DeviceFarm"; +import { DeviceFarmClient } from "../DeviceFarmClient"; +import { ListSuitesCommand, ListSuitesCommandInput, ListSuitesCommandOutput } from "../commands/ListSuitesCommand"; +import { DeviceFarmPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DeviceFarmClient, + input: ListSuitesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListSuitesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DeviceFarm, + input: ListSuitesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listSuites(input, ...args); +}; +export async function* listSuitesPaginate( + config: DeviceFarmPaginationConfiguration, + input: ListSuitesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListSuitesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + if (config.client instanceof DeviceFarm) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DeviceFarmClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DeviceFarm | DeviceFarmClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-device-farm/pagination/ListTestGridProjectsPaginator.ts b/clients/client-device-farm/pagination/ListTestGridProjectsPaginator.ts new file mode 100644 index 0000000000000..260c50273c4d6 --- /dev/null +++ b/clients/client-device-farm/pagination/ListTestGridProjectsPaginator.ts @@ -0,0 +1,51 @@ +import { DeviceFarm } from "../DeviceFarm"; +import { DeviceFarmClient } from "../DeviceFarmClient"; +import { + ListTestGridProjectsCommand, + ListTestGridProjectsCommandInput, + ListTestGridProjectsCommandOutput, +} from "../commands/ListTestGridProjectsCommand"; +import { DeviceFarmPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DeviceFarmClient, + input: ListTestGridProjectsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTestGridProjectsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DeviceFarm, + input: ListTestGridProjectsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTestGridProjects(input, ...args); +}; +export async function* listTestGridProjectsPaginate( + config: DeviceFarmPaginationConfiguration, + input: ListTestGridProjectsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTestGridProjectsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResult"] = config.pageSize; + if (config.client instanceof DeviceFarm) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DeviceFarmClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DeviceFarm | DeviceFarmClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-device-farm/pagination/ListTestGridSessionActionsPaginator.ts b/clients/client-device-farm/pagination/ListTestGridSessionActionsPaginator.ts new file mode 100644 index 0000000000000..47306a487ae4b --- /dev/null +++ b/clients/client-device-farm/pagination/ListTestGridSessionActionsPaginator.ts @@ -0,0 +1,51 @@ +import { DeviceFarm } from "../DeviceFarm"; +import { DeviceFarmClient } from "../DeviceFarmClient"; +import { + ListTestGridSessionActionsCommand, + ListTestGridSessionActionsCommandInput, + ListTestGridSessionActionsCommandOutput, +} from "../commands/ListTestGridSessionActionsCommand"; +import { DeviceFarmPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DeviceFarmClient, + input: ListTestGridSessionActionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTestGridSessionActionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DeviceFarm, + input: ListTestGridSessionActionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTestGridSessionActions(input, ...args); +}; +export async function* listTestGridSessionActionsPaginate( + config: DeviceFarmPaginationConfiguration, + input: ListTestGridSessionActionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTestGridSessionActionsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResult"] = config.pageSize; + if (config.client instanceof DeviceFarm) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DeviceFarmClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DeviceFarm | DeviceFarmClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-device-farm/pagination/ListTestGridSessionArtifactsPaginator.ts b/clients/client-device-farm/pagination/ListTestGridSessionArtifactsPaginator.ts new file mode 100644 index 0000000000000..1c10d0e7802e7 --- /dev/null +++ b/clients/client-device-farm/pagination/ListTestGridSessionArtifactsPaginator.ts @@ -0,0 +1,51 @@ +import { DeviceFarm } from "../DeviceFarm"; +import { DeviceFarmClient } from "../DeviceFarmClient"; +import { + ListTestGridSessionArtifactsCommand, + ListTestGridSessionArtifactsCommandInput, + ListTestGridSessionArtifactsCommandOutput, +} from "../commands/ListTestGridSessionArtifactsCommand"; +import { DeviceFarmPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DeviceFarmClient, + input: ListTestGridSessionArtifactsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTestGridSessionArtifactsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DeviceFarm, + input: ListTestGridSessionArtifactsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTestGridSessionArtifacts(input, ...args); +}; +export async function* listTestGridSessionArtifactsPaginate( + config: DeviceFarmPaginationConfiguration, + input: ListTestGridSessionArtifactsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTestGridSessionArtifactsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResult"] = config.pageSize; + if (config.client instanceof DeviceFarm) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DeviceFarmClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DeviceFarm | DeviceFarmClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-device-farm/pagination/ListTestGridSessionsPaginator.ts b/clients/client-device-farm/pagination/ListTestGridSessionsPaginator.ts new file mode 100644 index 0000000000000..90a587c470bcc --- /dev/null +++ b/clients/client-device-farm/pagination/ListTestGridSessionsPaginator.ts @@ -0,0 +1,51 @@ +import { DeviceFarm } from "../DeviceFarm"; +import { DeviceFarmClient } from "../DeviceFarmClient"; +import { + ListTestGridSessionsCommand, + ListTestGridSessionsCommandInput, + ListTestGridSessionsCommandOutput, +} from "../commands/ListTestGridSessionsCommand"; +import { DeviceFarmPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DeviceFarmClient, + input: ListTestGridSessionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTestGridSessionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DeviceFarm, + input: ListTestGridSessionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTestGridSessions(input, ...args); +}; +export async function* listTestGridSessionsPaginate( + config: DeviceFarmPaginationConfiguration, + input: ListTestGridSessionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTestGridSessionsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResult"] = config.pageSize; + if (config.client instanceof DeviceFarm) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DeviceFarmClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DeviceFarm | DeviceFarmClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-device-farm/pagination/ListTestsPaginator.ts b/clients/client-device-farm/pagination/ListTestsPaginator.ts new file mode 100644 index 0000000000000..a44b93ee7bc23 --- /dev/null +++ b/clients/client-device-farm/pagination/ListTestsPaginator.ts @@ -0,0 +1,46 @@ +import { DeviceFarm } from "../DeviceFarm"; +import { DeviceFarmClient } from "../DeviceFarmClient"; +import { ListTestsCommand, ListTestsCommandInput, ListTestsCommandOutput } from "../commands/ListTestsCommand"; +import { DeviceFarmPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DeviceFarmClient, + input: ListTestsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTestsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DeviceFarm, + input: ListTestsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTests(input, ...args); +}; +export async function* listTestsPaginate( + config: DeviceFarmPaginationConfiguration, + input: ListTestsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTestsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + if (config.client instanceof DeviceFarm) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DeviceFarmClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DeviceFarm | DeviceFarmClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-device-farm/pagination/ListUniqueProblemsPaginator.ts b/clients/client-device-farm/pagination/ListUniqueProblemsPaginator.ts new file mode 100644 index 0000000000000..3f43b84a9e943 --- /dev/null +++ b/clients/client-device-farm/pagination/ListUniqueProblemsPaginator.ts @@ -0,0 +1,50 @@ +import { DeviceFarm } from "../DeviceFarm"; +import { DeviceFarmClient } from "../DeviceFarmClient"; +import { + ListUniqueProblemsCommand, + ListUniqueProblemsCommandInput, + ListUniqueProblemsCommandOutput, +} from "../commands/ListUniqueProblemsCommand"; +import { DeviceFarmPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DeviceFarmClient, + input: ListUniqueProblemsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListUniqueProblemsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DeviceFarm, + input: ListUniqueProblemsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listUniqueProblems(input, ...args); +}; +export async function* listUniqueProblemsPaginate( + config: DeviceFarmPaginationConfiguration, + input: ListUniqueProblemsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListUniqueProblemsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + if (config.client instanceof DeviceFarm) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DeviceFarmClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DeviceFarm | DeviceFarmClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-device-farm/pagination/ListUploadsPaginator.ts b/clients/client-device-farm/pagination/ListUploadsPaginator.ts new file mode 100644 index 0000000000000..f2eeb8a390c93 --- /dev/null +++ b/clients/client-device-farm/pagination/ListUploadsPaginator.ts @@ -0,0 +1,46 @@ +import { DeviceFarm } from "../DeviceFarm"; +import { DeviceFarmClient } from "../DeviceFarmClient"; +import { ListUploadsCommand, ListUploadsCommandInput, ListUploadsCommandOutput } from "../commands/ListUploadsCommand"; +import { DeviceFarmPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DeviceFarmClient, + input: ListUploadsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListUploadsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DeviceFarm, + input: ListUploadsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listUploads(input, ...args); +}; +export async function* listUploadsPaginate( + config: DeviceFarmPaginationConfiguration, + input: ListUploadsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListUploadsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + if (config.client instanceof DeviceFarm) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DeviceFarmClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DeviceFarm | DeviceFarmClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-directory-service/index.ts b/clients/client-directory-service/index.ts index fc9fe6fdbcf1a..014f2ed4f829f 100644 --- a/clients/client-directory-service/index.ts +++ b/clients/client-directory-service/index.ts @@ -24,6 +24,7 @@ export * from "./commands/DescribeCertificateCommand"; export * from "./commands/DescribeConditionalForwardersCommand"; export * from "./commands/DescribeDirectoriesCommand"; export * from "./commands/DescribeDomainControllersCommand"; +export * from "./pagination/DescribeDomainControllersPaginator"; export * from "./commands/DescribeEventTopicsCommand"; export * from "./commands/DescribeLDAPSSettingsCommand"; export * from "./commands/DescribeSharedDirectoriesCommand"; @@ -57,4 +58,5 @@ export * from "./commands/UpdateNumberOfDomainControllersCommand"; export * from "./commands/UpdateRadiusCommand"; export * from "./commands/UpdateTrustCommand"; export * from "./commands/VerifyTrustCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-directory-service/pagination/DescribeDomainControllersPaginator.ts b/clients/client-directory-service/pagination/DescribeDomainControllersPaginator.ts new file mode 100644 index 0000000000000..8245493c8e288 --- /dev/null +++ b/clients/client-directory-service/pagination/DescribeDomainControllersPaginator.ts @@ -0,0 +1,51 @@ +import { DirectoryService } from "../DirectoryService"; +import { DirectoryServiceClient } from "../DirectoryServiceClient"; +import { + DescribeDomainControllersCommand, + DescribeDomainControllersCommandInput, + DescribeDomainControllersCommandOutput, +} from "../commands/DescribeDomainControllersCommand"; +import { DirectoryServicePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DirectoryServiceClient, + input: DescribeDomainControllersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeDomainControllersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DirectoryService, + input: DescribeDomainControllersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeDomainControllers(input, ...args); +}; +export async function* describeDomainControllersPaginate( + config: DirectoryServicePaginationConfiguration, + input: DescribeDomainControllersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeDomainControllersCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["Limit"] = config.pageSize; + if (config.client instanceof DirectoryService) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DirectoryServiceClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DirectoryService | DirectoryServiceClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-directory-service/pagination/Interfaces.ts b/clients/client-directory-service/pagination/Interfaces.ts new file mode 100644 index 0000000000000..4d84f9e03bd1a --- /dev/null +++ b/clients/client-directory-service/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { DirectoryService } from "../DirectoryService"; +import { DirectoryServiceClient } from "../DirectoryServiceClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface DirectoryServicePaginationConfiguration extends PaginationConfiguration { + client: DirectoryService | DirectoryServiceClient; +} diff --git a/clients/client-docdb/index.ts b/clients/client-docdb/index.ts index 860cee7186397..b7188c9902ff2 100644 --- a/clients/client-docdb/index.ts +++ b/clients/client-docdb/index.ts @@ -18,15 +18,21 @@ export * from "./commands/DescribeCertificatesCommand"; export * from "./commands/DescribeDBClusterParameterGroupsCommand"; export * from "./commands/DescribeDBClusterParametersCommand"; export * from "./commands/DescribeDBClustersCommand"; +export * from "./pagination/DescribeDBClustersPaginator"; export * from "./commands/DescribeDBClusterSnapshotAttributesCommand"; export * from "./commands/DescribeDBClusterSnapshotsCommand"; export * from "./commands/DescribeDBEngineVersionsCommand"; +export * from "./pagination/DescribeDBEngineVersionsPaginator"; export * from "./commands/DescribeDBInstancesCommand"; +export * from "./pagination/DescribeDBInstancesPaginator"; export * from "./commands/DescribeDBSubnetGroupsCommand"; +export * from "./pagination/DescribeDBSubnetGroupsPaginator"; export * from "./commands/DescribeEngineDefaultClusterParametersCommand"; export * from "./commands/DescribeEventCategoriesCommand"; export * from "./commands/DescribeEventsCommand"; +export * from "./pagination/DescribeEventsPaginator"; export * from "./commands/DescribeOrderableDBInstanceOptionsCommand"; +export * from "./pagination/DescribeOrderableDBInstanceOptionsPaginator"; export * from "./commands/DescribePendingMaintenanceActionsCommand"; export * from "./commands/FailoverDBClusterCommand"; export * from "./commands/ListTagsForResourceCommand"; @@ -42,4 +48,5 @@ export * from "./commands/RestoreDBClusterFromSnapshotCommand"; export * from "./commands/RestoreDBClusterToPointInTimeCommand"; export * from "./commands/StartDBClusterCommand"; export * from "./commands/StopDBClusterCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-docdb/pagination/DescribeDBClustersPaginator.ts b/clients/client-docdb/pagination/DescribeDBClustersPaginator.ts new file mode 100644 index 0000000000000..0eb04373ac826 --- /dev/null +++ b/clients/client-docdb/pagination/DescribeDBClustersPaginator.ts @@ -0,0 +1,51 @@ +import { DocDB } from "../DocDB"; +import { DocDBClient } from "../DocDBClient"; +import { + DescribeDBClustersCommand, + DescribeDBClustersCommandInput, + DescribeDBClustersCommandOutput, +} from "../commands/DescribeDBClustersCommand"; +import { DocDBPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DocDBClient, + input: DescribeDBClustersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeDBClustersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DocDB, + input: DescribeDBClustersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeDBClusters(input, ...args); +}; +export async function* describeDBClustersPaginate( + config: DocDBPaginationConfiguration, + input: DescribeDBClustersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeDBClustersCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof DocDB) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DocDBClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DocDB | DocDBClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-docdb/pagination/DescribeDBEngineVersionsPaginator.ts b/clients/client-docdb/pagination/DescribeDBEngineVersionsPaginator.ts new file mode 100644 index 0000000000000..fe9225584ed94 --- /dev/null +++ b/clients/client-docdb/pagination/DescribeDBEngineVersionsPaginator.ts @@ -0,0 +1,51 @@ +import { DocDB } from "../DocDB"; +import { DocDBClient } from "../DocDBClient"; +import { + DescribeDBEngineVersionsCommand, + DescribeDBEngineVersionsCommandInput, + DescribeDBEngineVersionsCommandOutput, +} from "../commands/DescribeDBEngineVersionsCommand"; +import { DocDBPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DocDBClient, + input: DescribeDBEngineVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeDBEngineVersionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DocDB, + input: DescribeDBEngineVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeDBEngineVersions(input, ...args); +}; +export async function* describeDBEngineVersionsPaginate( + config: DocDBPaginationConfiguration, + input: DescribeDBEngineVersionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeDBEngineVersionsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof DocDB) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DocDBClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DocDB | DocDBClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-docdb/pagination/DescribeDBInstancesPaginator.ts b/clients/client-docdb/pagination/DescribeDBInstancesPaginator.ts new file mode 100644 index 0000000000000..a4b426defbebe --- /dev/null +++ b/clients/client-docdb/pagination/DescribeDBInstancesPaginator.ts @@ -0,0 +1,51 @@ +import { DocDB } from "../DocDB"; +import { DocDBClient } from "../DocDBClient"; +import { + DescribeDBInstancesCommand, + DescribeDBInstancesCommandInput, + DescribeDBInstancesCommandOutput, +} from "../commands/DescribeDBInstancesCommand"; +import { DocDBPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DocDBClient, + input: DescribeDBInstancesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeDBInstancesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DocDB, + input: DescribeDBInstancesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeDBInstances(input, ...args); +}; +export async function* describeDBInstancesPaginate( + config: DocDBPaginationConfiguration, + input: DescribeDBInstancesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeDBInstancesCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof DocDB) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DocDBClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DocDB | DocDBClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-docdb/pagination/DescribeDBSubnetGroupsPaginator.ts b/clients/client-docdb/pagination/DescribeDBSubnetGroupsPaginator.ts new file mode 100644 index 0000000000000..9f4357a036040 --- /dev/null +++ b/clients/client-docdb/pagination/DescribeDBSubnetGroupsPaginator.ts @@ -0,0 +1,51 @@ +import { DocDB } from "../DocDB"; +import { DocDBClient } from "../DocDBClient"; +import { + DescribeDBSubnetGroupsCommand, + DescribeDBSubnetGroupsCommandInput, + DescribeDBSubnetGroupsCommandOutput, +} from "../commands/DescribeDBSubnetGroupsCommand"; +import { DocDBPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DocDBClient, + input: DescribeDBSubnetGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeDBSubnetGroupsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DocDB, + input: DescribeDBSubnetGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeDBSubnetGroups(input, ...args); +}; +export async function* describeDBSubnetGroupsPaginate( + config: DocDBPaginationConfiguration, + input: DescribeDBSubnetGroupsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeDBSubnetGroupsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof DocDB) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DocDBClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DocDB | DocDBClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-docdb/pagination/DescribeEventsPaginator.ts b/clients/client-docdb/pagination/DescribeEventsPaginator.ts new file mode 100644 index 0000000000000..0183703404ea4 --- /dev/null +++ b/clients/client-docdb/pagination/DescribeEventsPaginator.ts @@ -0,0 +1,51 @@ +import { DocDB } from "../DocDB"; +import { DocDBClient } from "../DocDBClient"; +import { + DescribeEventsCommand, + DescribeEventsCommandInput, + DescribeEventsCommandOutput, +} from "../commands/DescribeEventsCommand"; +import { DocDBPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DocDBClient, + input: DescribeEventsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeEventsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DocDB, + input: DescribeEventsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeEvents(input, ...args); +}; +export async function* describeEventsPaginate( + config: DocDBPaginationConfiguration, + input: DescribeEventsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeEventsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof DocDB) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DocDBClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DocDB | DocDBClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-docdb/pagination/DescribeOrderableDBInstanceOptionsPaginator.ts b/clients/client-docdb/pagination/DescribeOrderableDBInstanceOptionsPaginator.ts new file mode 100644 index 0000000000000..a7faa9f413dcb --- /dev/null +++ b/clients/client-docdb/pagination/DescribeOrderableDBInstanceOptionsPaginator.ts @@ -0,0 +1,51 @@ +import { DocDB } from "../DocDB"; +import { DocDBClient } from "../DocDBClient"; +import { + DescribeOrderableDBInstanceOptionsCommand, + DescribeOrderableDBInstanceOptionsCommandInput, + DescribeOrderableDBInstanceOptionsCommandOutput, +} from "../commands/DescribeOrderableDBInstanceOptionsCommand"; +import { DocDBPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DocDBClient, + input: DescribeOrderableDBInstanceOptionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeOrderableDBInstanceOptionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DocDB, + input: DescribeOrderableDBInstanceOptionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeOrderableDBInstanceOptions(input, ...args); +}; +export async function* describeOrderableDBInstanceOptionsPaginate( + config: DocDBPaginationConfiguration, + input: DescribeOrderableDBInstanceOptionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeOrderableDBInstanceOptionsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof DocDB) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DocDBClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DocDB | DocDBClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-docdb/pagination/Interfaces.ts b/clients/client-docdb/pagination/Interfaces.ts new file mode 100644 index 0000000000000..170fb600398f9 --- /dev/null +++ b/clients/client-docdb/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { DocDB } from "../DocDB"; +import { DocDBClient } from "../DocDBClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface DocDBPaginationConfiguration extends PaginationConfiguration { + client: DocDB | DocDBClient; +} diff --git a/clients/client-dynamodb/index.ts b/clients/client-dynamodb/index.ts index 9dabd6441d046..2c55a19e530be 100644 --- a/clients/client-dynamodb/index.ts +++ b/clients/client-dynamodb/index.ts @@ -21,8 +21,10 @@ export * from "./commands/DescribeTimeToLiveCommand"; export * from "./commands/GetItemCommand"; export * from "./commands/ListBackupsCommand"; export * from "./commands/ListContributorInsightsCommand"; +export * from "./pagination/ListContributorInsightsPaginator"; export * from "./commands/ListGlobalTablesCommand"; export * from "./commands/ListTablesCommand"; +export * from "./pagination/ListTablesPaginator"; export * from "./commands/ListTagsOfResourceCommand"; export * from "./commands/PutItemCommand"; export * from "./commands/QueryCommand"; @@ -41,4 +43,5 @@ export * from "./commands/UpdateItemCommand"; export * from "./commands/UpdateTableCommand"; export * from "./commands/UpdateTableReplicaAutoScalingCommand"; export * from "./commands/UpdateTimeToLiveCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-dynamodb/pagination/Interfaces.ts b/clients/client-dynamodb/pagination/Interfaces.ts new file mode 100644 index 0000000000000..a804c8bfda630 --- /dev/null +++ b/clients/client-dynamodb/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { DynamoDB } from "../DynamoDB"; +import { DynamoDBClient } from "../DynamoDBClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface DynamoDBPaginationConfiguration extends PaginationConfiguration { + client: DynamoDB | DynamoDBClient; +} diff --git a/clients/client-dynamodb/pagination/ListContributorInsightsPaginator.ts b/clients/client-dynamodb/pagination/ListContributorInsightsPaginator.ts new file mode 100644 index 0000000000000..01d72277ef1ee --- /dev/null +++ b/clients/client-dynamodb/pagination/ListContributorInsightsPaginator.ts @@ -0,0 +1,51 @@ +import { DynamoDB } from "../DynamoDB"; +import { DynamoDBClient } from "../DynamoDBClient"; +import { + ListContributorInsightsCommand, + ListContributorInsightsCommandInput, + ListContributorInsightsCommandOutput, +} from "../commands/ListContributorInsightsCommand"; +import { DynamoDBPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DynamoDBClient, + input: ListContributorInsightsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListContributorInsightsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DynamoDB, + input: ListContributorInsightsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listContributorInsights(input, ...args); +}; +export async function* listContributorInsightsPaginate( + config: DynamoDBPaginationConfiguration, + input: ListContributorInsightsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListContributorInsightsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof DynamoDB) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DynamoDBClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DynamoDB | DynamoDBClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-dynamodb/pagination/ListTablesPaginator.ts b/clients/client-dynamodb/pagination/ListTablesPaginator.ts new file mode 100644 index 0000000000000..411c746c43287 --- /dev/null +++ b/clients/client-dynamodb/pagination/ListTablesPaginator.ts @@ -0,0 +1,47 @@ +import { DynamoDB } from "../DynamoDB"; +import { DynamoDBClient } from "../DynamoDBClient"; +import { ListTablesCommand, ListTablesCommandInput, ListTablesCommandOutput } from "../commands/ListTablesCommand"; +import { DynamoDBPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: DynamoDBClient, + input: ListTablesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTablesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: DynamoDB, + input: ListTablesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTables(input, ...args); +}; +export async function* listTablesPaginate( + config: DynamoDBPaginationConfiguration, + input: ListTablesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTablesCommandOutput; + while (hasNext) { + input["ExclusiveStartTableName"] = token; + input["Limit"] = config.pageSize; + if (config.client instanceof DynamoDB) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof DynamoDBClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected DynamoDB | DynamoDBClient"); + } + yield page; + token = page["LastEvaluatedTableName"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-ebs/index.ts b/clients/client-ebs/index.ts index ccbffa520fc24..074afabeae8a0 100644 --- a/clients/client-ebs/index.ts +++ b/clients/client-ebs/index.ts @@ -3,7 +3,10 @@ export * from "./EBS"; export * from "./commands/CompleteSnapshotCommand"; export * from "./commands/GetSnapshotBlockCommand"; export * from "./commands/ListChangedBlocksCommand"; +export * from "./pagination/ListChangedBlocksPaginator"; export * from "./commands/ListSnapshotBlocksCommand"; +export * from "./pagination/ListSnapshotBlocksPaginator"; export * from "./commands/PutSnapshotBlockCommand"; export * from "./commands/StartSnapshotCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-ebs/pagination/Interfaces.ts b/clients/client-ebs/pagination/Interfaces.ts new file mode 100644 index 0000000000000..15a6382c3ace6 --- /dev/null +++ b/clients/client-ebs/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { EBS } from "../EBS"; +import { EBSClient } from "../EBSClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface EBSPaginationConfiguration extends PaginationConfiguration { + client: EBS | EBSClient; +} diff --git a/clients/client-ebs/pagination/ListChangedBlocksPaginator.ts b/clients/client-ebs/pagination/ListChangedBlocksPaginator.ts new file mode 100644 index 0000000000000..412d174e61877 --- /dev/null +++ b/clients/client-ebs/pagination/ListChangedBlocksPaginator.ts @@ -0,0 +1,51 @@ +import { EBS } from "../EBS"; +import { EBSClient } from "../EBSClient"; +import { + ListChangedBlocksCommand, + ListChangedBlocksCommandInput, + ListChangedBlocksCommandOutput, +} from "../commands/ListChangedBlocksCommand"; +import { EBSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: EBSClient, + input: ListChangedBlocksCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListChangedBlocksCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: EBS, + input: ListChangedBlocksCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listChangedBlocks(input, ...args); +}; +export async function* listChangedBlocksPaginate( + config: EBSPaginationConfiguration, + input: ListChangedBlocksCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListChangedBlocksCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof EBS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof EBSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected EBS | EBSClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-ebs/pagination/ListSnapshotBlocksPaginator.ts b/clients/client-ebs/pagination/ListSnapshotBlocksPaginator.ts new file mode 100644 index 0000000000000..626a59bb02194 --- /dev/null +++ b/clients/client-ebs/pagination/ListSnapshotBlocksPaginator.ts @@ -0,0 +1,51 @@ +import { EBS } from "../EBS"; +import { EBSClient } from "../EBSClient"; +import { + ListSnapshotBlocksCommand, + ListSnapshotBlocksCommandInput, + ListSnapshotBlocksCommandOutput, +} from "../commands/ListSnapshotBlocksCommand"; +import { EBSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: EBSClient, + input: ListSnapshotBlocksCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListSnapshotBlocksCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: EBS, + input: ListSnapshotBlocksCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listSnapshotBlocks(input, ...args); +}; +export async function* listSnapshotBlocksPaginate( + config: EBSPaginationConfiguration, + input: ListSnapshotBlocksCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListSnapshotBlocksCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof EBS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof EBSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected EBS | EBSClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-ecr/index.ts b/clients/client-ecr/index.ts index b00831173239b..80602cb2d34b4 100644 --- a/clients/client-ecr/index.ts +++ b/clients/client-ecr/index.ts @@ -9,15 +9,20 @@ export * from "./commands/DeleteLifecyclePolicyCommand"; export * from "./commands/DeleteRepositoryCommand"; export * from "./commands/DeleteRepositoryPolicyCommand"; export * from "./commands/DescribeImagesCommand"; +export * from "./pagination/DescribeImagesPaginator"; export * from "./commands/DescribeImageScanFindingsCommand"; +export * from "./pagination/DescribeImageScanFindingsPaginator"; export * from "./commands/DescribeRepositoriesCommand"; +export * from "./pagination/DescribeRepositoriesPaginator"; export * from "./commands/GetAuthorizationTokenCommand"; export * from "./commands/GetDownloadUrlForLayerCommand"; export * from "./commands/GetLifecyclePolicyCommand"; export * from "./commands/GetLifecyclePolicyPreviewCommand"; +export * from "./pagination/GetLifecyclePolicyPreviewPaginator"; export * from "./commands/GetRepositoryPolicyCommand"; export * from "./commands/InitiateLayerUploadCommand"; export * from "./commands/ListImagesCommand"; +export * from "./pagination/ListImagesPaginator"; export * from "./commands/ListTagsForResourceCommand"; export * from "./commands/PutImageCommand"; export * from "./commands/PutImageScanningConfigurationCommand"; @@ -29,4 +34,5 @@ export * from "./commands/StartLifecyclePolicyPreviewCommand"; export * from "./commands/TagResourceCommand"; export * from "./commands/UntagResourceCommand"; export * from "./commands/UploadLayerPartCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-ecr/pagination/DescribeImageScanFindingsPaginator.ts b/clients/client-ecr/pagination/DescribeImageScanFindingsPaginator.ts new file mode 100644 index 0000000000000..f3e8970b0d3bb --- /dev/null +++ b/clients/client-ecr/pagination/DescribeImageScanFindingsPaginator.ts @@ -0,0 +1,51 @@ +import { ECR } from "../ECR"; +import { ECRClient } from "../ECRClient"; +import { + DescribeImageScanFindingsCommand, + DescribeImageScanFindingsCommandInput, + DescribeImageScanFindingsCommandOutput, +} from "../commands/DescribeImageScanFindingsCommand"; +import { ECRPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ECRClient, + input: DescribeImageScanFindingsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeImageScanFindingsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ECR, + input: DescribeImageScanFindingsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeImageScanFindings(input, ...args); +}; +export async function* describeImageScanFindingsPaginate( + config: ECRPaginationConfiguration, + input: DescribeImageScanFindingsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeImageScanFindingsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof ECR) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ECRClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ECR | ECRClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-ecr/pagination/DescribeImagesPaginator.ts b/clients/client-ecr/pagination/DescribeImagesPaginator.ts new file mode 100644 index 0000000000000..2ae82eb33e3f4 --- /dev/null +++ b/clients/client-ecr/pagination/DescribeImagesPaginator.ts @@ -0,0 +1,51 @@ +import { ECR } from "../ECR"; +import { ECRClient } from "../ECRClient"; +import { + DescribeImagesCommand, + DescribeImagesCommandInput, + DescribeImagesCommandOutput, +} from "../commands/DescribeImagesCommand"; +import { ECRPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ECRClient, + input: DescribeImagesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeImagesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ECR, + input: DescribeImagesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeImages(input, ...args); +}; +export async function* describeImagesPaginate( + config: ECRPaginationConfiguration, + input: DescribeImagesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeImagesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof ECR) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ECRClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ECR | ECRClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-ecr/pagination/DescribeRepositoriesPaginator.ts b/clients/client-ecr/pagination/DescribeRepositoriesPaginator.ts new file mode 100644 index 0000000000000..90d28dfe17d46 --- /dev/null +++ b/clients/client-ecr/pagination/DescribeRepositoriesPaginator.ts @@ -0,0 +1,51 @@ +import { ECR } from "../ECR"; +import { ECRClient } from "../ECRClient"; +import { + DescribeRepositoriesCommand, + DescribeRepositoriesCommandInput, + DescribeRepositoriesCommandOutput, +} from "../commands/DescribeRepositoriesCommand"; +import { ECRPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ECRClient, + input: DescribeRepositoriesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeRepositoriesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ECR, + input: DescribeRepositoriesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeRepositories(input, ...args); +}; +export async function* describeRepositoriesPaginate( + config: ECRPaginationConfiguration, + input: DescribeRepositoriesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeRepositoriesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof ECR) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ECRClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ECR | ECRClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-ecr/pagination/GetLifecyclePolicyPreviewPaginator.ts b/clients/client-ecr/pagination/GetLifecyclePolicyPreviewPaginator.ts new file mode 100644 index 0000000000000..34bd569496f77 --- /dev/null +++ b/clients/client-ecr/pagination/GetLifecyclePolicyPreviewPaginator.ts @@ -0,0 +1,51 @@ +import { ECR } from "../ECR"; +import { ECRClient } from "../ECRClient"; +import { + GetLifecyclePolicyPreviewCommand, + GetLifecyclePolicyPreviewCommandInput, + GetLifecyclePolicyPreviewCommandOutput, +} from "../commands/GetLifecyclePolicyPreviewCommand"; +import { ECRPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ECRClient, + input: GetLifecyclePolicyPreviewCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetLifecyclePolicyPreviewCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ECR, + input: GetLifecyclePolicyPreviewCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getLifecyclePolicyPreview(input, ...args); +}; +export async function* getLifecyclePolicyPreviewPaginate( + config: ECRPaginationConfiguration, + input: GetLifecyclePolicyPreviewCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetLifecyclePolicyPreviewCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof ECR) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ECRClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ECR | ECRClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-ecr/pagination/Interfaces.ts b/clients/client-ecr/pagination/Interfaces.ts new file mode 100644 index 0000000000000..8262214bbc741 --- /dev/null +++ b/clients/client-ecr/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { ECR } from "../ECR"; +import { ECRClient } from "../ECRClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface ECRPaginationConfiguration extends PaginationConfiguration { + client: ECR | ECRClient; +} diff --git a/clients/client-ecr/pagination/ListImagesPaginator.ts b/clients/client-ecr/pagination/ListImagesPaginator.ts new file mode 100644 index 0000000000000..1be6177254438 --- /dev/null +++ b/clients/client-ecr/pagination/ListImagesPaginator.ts @@ -0,0 +1,47 @@ +import { ECR } from "../ECR"; +import { ECRClient } from "../ECRClient"; +import { ListImagesCommand, ListImagesCommandInput, ListImagesCommandOutput } from "../commands/ListImagesCommand"; +import { ECRPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ECRClient, + input: ListImagesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListImagesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ECR, + input: ListImagesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listImages(input, ...args); +}; +export async function* listImagesPaginate( + config: ECRPaginationConfiguration, + input: ListImagesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListImagesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof ECR) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ECRClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ECR | ECRClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-ecs/index.ts b/clients/client-ecs/index.ts index 71c65244759cc..1aeb5096cd25d 100644 --- a/clients/client-ecs/index.ts +++ b/clients/client-ecs/index.ts @@ -21,14 +21,22 @@ export * from "./commands/DescribeTasksCommand"; export * from "./commands/DescribeTaskSetsCommand"; export * from "./commands/DiscoverPollEndpointCommand"; export * from "./commands/ListAccountSettingsCommand"; +export * from "./pagination/ListAccountSettingsPaginator"; export * from "./commands/ListAttributesCommand"; +export * from "./pagination/ListAttributesPaginator"; export * from "./commands/ListClustersCommand"; +export * from "./pagination/ListClustersPaginator"; export * from "./commands/ListContainerInstancesCommand"; +export * from "./pagination/ListContainerInstancesPaginator"; export * from "./commands/ListServicesCommand"; +export * from "./pagination/ListServicesPaginator"; export * from "./commands/ListTagsForResourceCommand"; export * from "./commands/ListTaskDefinitionFamiliesCommand"; +export * from "./pagination/ListTaskDefinitionFamiliesPaginator"; export * from "./commands/ListTaskDefinitionsCommand"; +export * from "./pagination/ListTaskDefinitionsPaginator"; export * from "./commands/ListTasksCommand"; +export * from "./pagination/ListTasksPaginator"; export * from "./commands/PutAccountSettingCommand"; export * from "./commands/PutAccountSettingDefaultCommand"; export * from "./commands/PutAttributesCommand"; @@ -49,4 +57,5 @@ export * from "./commands/UpdateContainerInstancesStateCommand"; export * from "./commands/UpdateServiceCommand"; export * from "./commands/UpdateServicePrimaryTaskSetCommand"; export * from "./commands/UpdateTaskSetCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-ecs/pagination/Interfaces.ts b/clients/client-ecs/pagination/Interfaces.ts new file mode 100644 index 0000000000000..c19f1c3471071 --- /dev/null +++ b/clients/client-ecs/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { ECS } from "../ECS"; +import { ECSClient } from "../ECSClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface ECSPaginationConfiguration extends PaginationConfiguration { + client: ECS | ECSClient; +} diff --git a/clients/client-ecs/pagination/ListAccountSettingsPaginator.ts b/clients/client-ecs/pagination/ListAccountSettingsPaginator.ts new file mode 100644 index 0000000000000..ba3d345411e4e --- /dev/null +++ b/clients/client-ecs/pagination/ListAccountSettingsPaginator.ts @@ -0,0 +1,51 @@ +import { ECS } from "../ECS"; +import { ECSClient } from "../ECSClient"; +import { + ListAccountSettingsCommand, + ListAccountSettingsCommandInput, + ListAccountSettingsCommandOutput, +} from "../commands/ListAccountSettingsCommand"; +import { ECSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ECSClient, + input: ListAccountSettingsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListAccountSettingsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ECS, + input: ListAccountSettingsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listAccountSettings(input, ...args); +}; +export async function* listAccountSettingsPaginate( + config: ECSPaginationConfiguration, + input: ListAccountSettingsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListAccountSettingsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof ECS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ECSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ECS | ECSClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-ecs/pagination/ListAttributesPaginator.ts b/clients/client-ecs/pagination/ListAttributesPaginator.ts new file mode 100644 index 0000000000000..796d95056e0b1 --- /dev/null +++ b/clients/client-ecs/pagination/ListAttributesPaginator.ts @@ -0,0 +1,51 @@ +import { ECS } from "../ECS"; +import { ECSClient } from "../ECSClient"; +import { + ListAttributesCommand, + ListAttributesCommandInput, + ListAttributesCommandOutput, +} from "../commands/ListAttributesCommand"; +import { ECSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ECSClient, + input: ListAttributesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListAttributesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ECS, + input: ListAttributesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listAttributes(input, ...args); +}; +export async function* listAttributesPaginate( + config: ECSPaginationConfiguration, + input: ListAttributesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListAttributesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof ECS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ECSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ECS | ECSClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-ecs/pagination/ListClustersPaginator.ts b/clients/client-ecs/pagination/ListClustersPaginator.ts new file mode 100644 index 0000000000000..968d41c09b107 --- /dev/null +++ b/clients/client-ecs/pagination/ListClustersPaginator.ts @@ -0,0 +1,51 @@ +import { ECS } from "../ECS"; +import { ECSClient } from "../ECSClient"; +import { + ListClustersCommand, + ListClustersCommandInput, + ListClustersCommandOutput, +} from "../commands/ListClustersCommand"; +import { ECSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ECSClient, + input: ListClustersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListClustersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ECS, + input: ListClustersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listClusters(input, ...args); +}; +export async function* listClustersPaginate( + config: ECSPaginationConfiguration, + input: ListClustersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListClustersCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof ECS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ECSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ECS | ECSClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-ecs/pagination/ListContainerInstancesPaginator.ts b/clients/client-ecs/pagination/ListContainerInstancesPaginator.ts new file mode 100644 index 0000000000000..d0598772436cd --- /dev/null +++ b/clients/client-ecs/pagination/ListContainerInstancesPaginator.ts @@ -0,0 +1,51 @@ +import { ECS } from "../ECS"; +import { ECSClient } from "../ECSClient"; +import { + ListContainerInstancesCommand, + ListContainerInstancesCommandInput, + ListContainerInstancesCommandOutput, +} from "../commands/ListContainerInstancesCommand"; +import { ECSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ECSClient, + input: ListContainerInstancesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListContainerInstancesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ECS, + input: ListContainerInstancesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listContainerInstances(input, ...args); +}; +export async function* listContainerInstancesPaginate( + config: ECSPaginationConfiguration, + input: ListContainerInstancesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListContainerInstancesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof ECS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ECSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ECS | ECSClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-ecs/pagination/ListServicesPaginator.ts b/clients/client-ecs/pagination/ListServicesPaginator.ts new file mode 100644 index 0000000000000..c75c7c0c99829 --- /dev/null +++ b/clients/client-ecs/pagination/ListServicesPaginator.ts @@ -0,0 +1,51 @@ +import { ECS } from "../ECS"; +import { ECSClient } from "../ECSClient"; +import { + ListServicesCommand, + ListServicesCommandInput, + ListServicesCommandOutput, +} from "../commands/ListServicesCommand"; +import { ECSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ECSClient, + input: ListServicesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListServicesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ECS, + input: ListServicesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listServices(input, ...args); +}; +export async function* listServicesPaginate( + config: ECSPaginationConfiguration, + input: ListServicesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListServicesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof ECS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ECSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ECS | ECSClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-ecs/pagination/ListTaskDefinitionFamiliesPaginator.ts b/clients/client-ecs/pagination/ListTaskDefinitionFamiliesPaginator.ts new file mode 100644 index 0000000000000..8022ccd0811e9 --- /dev/null +++ b/clients/client-ecs/pagination/ListTaskDefinitionFamiliesPaginator.ts @@ -0,0 +1,51 @@ +import { ECS } from "../ECS"; +import { ECSClient } from "../ECSClient"; +import { + ListTaskDefinitionFamiliesCommand, + ListTaskDefinitionFamiliesCommandInput, + ListTaskDefinitionFamiliesCommandOutput, +} from "../commands/ListTaskDefinitionFamiliesCommand"; +import { ECSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ECSClient, + input: ListTaskDefinitionFamiliesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTaskDefinitionFamiliesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ECS, + input: ListTaskDefinitionFamiliesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTaskDefinitionFamilies(input, ...args); +}; +export async function* listTaskDefinitionFamiliesPaginate( + config: ECSPaginationConfiguration, + input: ListTaskDefinitionFamiliesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTaskDefinitionFamiliesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof ECS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ECSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ECS | ECSClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-ecs/pagination/ListTaskDefinitionsPaginator.ts b/clients/client-ecs/pagination/ListTaskDefinitionsPaginator.ts new file mode 100644 index 0000000000000..66b1a95285078 --- /dev/null +++ b/clients/client-ecs/pagination/ListTaskDefinitionsPaginator.ts @@ -0,0 +1,51 @@ +import { ECS } from "../ECS"; +import { ECSClient } from "../ECSClient"; +import { + ListTaskDefinitionsCommand, + ListTaskDefinitionsCommandInput, + ListTaskDefinitionsCommandOutput, +} from "../commands/ListTaskDefinitionsCommand"; +import { ECSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ECSClient, + input: ListTaskDefinitionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTaskDefinitionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ECS, + input: ListTaskDefinitionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTaskDefinitions(input, ...args); +}; +export async function* listTaskDefinitionsPaginate( + config: ECSPaginationConfiguration, + input: ListTaskDefinitionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTaskDefinitionsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof ECS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ECSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ECS | ECSClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-ecs/pagination/ListTasksPaginator.ts b/clients/client-ecs/pagination/ListTasksPaginator.ts new file mode 100644 index 0000000000000..f79c5fe35d185 --- /dev/null +++ b/clients/client-ecs/pagination/ListTasksPaginator.ts @@ -0,0 +1,47 @@ +import { ECS } from "../ECS"; +import { ECSClient } from "../ECSClient"; +import { ListTasksCommand, ListTasksCommandInput, ListTasksCommandOutput } from "../commands/ListTasksCommand"; +import { ECSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ECSClient, + input: ListTasksCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTasksCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ECS, + input: ListTasksCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTasks(input, ...args); +}; +export async function* listTasksPaginate( + config: ECSPaginationConfiguration, + input: ListTasksCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTasksCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof ECS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ECSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ECS | ECSClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-efs/index.ts b/clients/client-efs/index.ts index 8df70a141bf8d..db74777bf1731 100644 --- a/clients/client-efs/index.ts +++ b/clients/client-efs/index.ts @@ -10,14 +10,18 @@ export * from "./commands/DeleteFileSystemPolicyCommand"; export * from "./commands/DeleteMountTargetCommand"; export * from "./commands/DeleteTagsCommand"; export * from "./commands/DescribeAccessPointsCommand"; +export * from "./pagination/DescribeAccessPointsPaginator"; export * from "./commands/DescribeBackupPolicyCommand"; export * from "./commands/DescribeFileSystemPolicyCommand"; export * from "./commands/DescribeFileSystemsCommand"; +export * from "./pagination/DescribeFileSystemsPaginator"; export * from "./commands/DescribeLifecycleConfigurationCommand"; export * from "./commands/DescribeMountTargetsCommand"; export * from "./commands/DescribeMountTargetSecurityGroupsCommand"; export * from "./commands/DescribeTagsCommand"; +export * from "./pagination/DescribeTagsPaginator"; export * from "./commands/ListTagsForResourceCommand"; +export * from "./pagination/ListTagsForResourcePaginator"; export * from "./commands/ModifyMountTargetSecurityGroupsCommand"; export * from "./commands/PutBackupPolicyCommand"; export * from "./commands/PutFileSystemPolicyCommand"; @@ -25,4 +29,5 @@ export * from "./commands/PutLifecycleConfigurationCommand"; export * from "./commands/TagResourceCommand"; export * from "./commands/UntagResourceCommand"; export * from "./commands/UpdateFileSystemCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-efs/pagination/DescribeAccessPointsPaginator.ts b/clients/client-efs/pagination/DescribeAccessPointsPaginator.ts new file mode 100644 index 0000000000000..5f1b055199197 --- /dev/null +++ b/clients/client-efs/pagination/DescribeAccessPointsPaginator.ts @@ -0,0 +1,51 @@ +import { EFS } from "../EFS"; +import { EFSClient } from "../EFSClient"; +import { + DescribeAccessPointsCommand, + DescribeAccessPointsCommandInput, + DescribeAccessPointsCommandOutput, +} from "../commands/DescribeAccessPointsCommand"; +import { EFSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: EFSClient, + input: DescribeAccessPointsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeAccessPointsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: EFS, + input: DescribeAccessPointsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeAccessPoints(input, ...args); +}; +export async function* describeAccessPointsPaginate( + config: EFSPaginationConfiguration, + input: DescribeAccessPointsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeAccessPointsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof EFS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof EFSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected EFS | EFSClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-efs/pagination/DescribeFileSystemsPaginator.ts b/clients/client-efs/pagination/DescribeFileSystemsPaginator.ts new file mode 100644 index 0000000000000..84b0551788514 --- /dev/null +++ b/clients/client-efs/pagination/DescribeFileSystemsPaginator.ts @@ -0,0 +1,51 @@ +import { EFS } from "../EFS"; +import { EFSClient } from "../EFSClient"; +import { + DescribeFileSystemsCommand, + DescribeFileSystemsCommandInput, + DescribeFileSystemsCommandOutput, +} from "../commands/DescribeFileSystemsCommand"; +import { EFSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: EFSClient, + input: DescribeFileSystemsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeFileSystemsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: EFS, + input: DescribeFileSystemsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeFileSystems(input, ...args); +}; +export async function* describeFileSystemsPaginate( + config: EFSPaginationConfiguration, + input: DescribeFileSystemsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeFileSystemsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxItems"] = config.pageSize; + if (config.client instanceof EFS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof EFSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected EFS | EFSClient"); + } + yield page; + token = page["NextMarker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-efs/pagination/DescribeTagsPaginator.ts b/clients/client-efs/pagination/DescribeTagsPaginator.ts new file mode 100644 index 0000000000000..e3ca2f9736c41 --- /dev/null +++ b/clients/client-efs/pagination/DescribeTagsPaginator.ts @@ -0,0 +1,51 @@ +import { EFS } from "../EFS"; +import { EFSClient } from "../EFSClient"; +import { + DescribeTagsCommand, + DescribeTagsCommandInput, + DescribeTagsCommandOutput, +} from "../commands/DescribeTagsCommand"; +import { EFSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: EFSClient, + input: DescribeTagsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeTagsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: EFS, + input: DescribeTagsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeTags(input, ...args); +}; +export async function* describeTagsPaginate( + config: EFSPaginationConfiguration, + input: DescribeTagsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeTagsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxItems"] = config.pageSize; + if (config.client instanceof EFS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof EFSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected EFS | EFSClient"); + } + yield page; + token = page["NextMarker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-efs/pagination/Interfaces.ts b/clients/client-efs/pagination/Interfaces.ts new file mode 100644 index 0000000000000..684ba012122b0 --- /dev/null +++ b/clients/client-efs/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { EFS } from "../EFS"; +import { EFSClient } from "../EFSClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface EFSPaginationConfiguration extends PaginationConfiguration { + client: EFS | EFSClient; +} diff --git a/clients/client-efs/pagination/ListTagsForResourcePaginator.ts b/clients/client-efs/pagination/ListTagsForResourcePaginator.ts new file mode 100644 index 0000000000000..4c0258e04752a --- /dev/null +++ b/clients/client-efs/pagination/ListTagsForResourcePaginator.ts @@ -0,0 +1,51 @@ +import { EFS } from "../EFS"; +import { EFSClient } from "../EFSClient"; +import { + ListTagsForResourceCommand, + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput, +} from "../commands/ListTagsForResourceCommand"; +import { EFSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: EFSClient, + input: ListTagsForResourceCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTagsForResourceCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: EFS, + input: ListTagsForResourceCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTagsForResource(input, ...args); +}; +export async function* listTagsForResourcePaginate( + config: EFSPaginationConfiguration, + input: ListTagsForResourceCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTagsForResourceCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof EFS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof EFSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected EFS | EFSClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-eks/index.ts b/clients/client-eks/index.ts index 86a71d48f2884..9d5d5676ab6ee 100644 --- a/clients/client-eks/index.ts +++ b/clients/client-eks/index.ts @@ -11,14 +11,19 @@ export * from "./commands/DescribeFargateProfileCommand"; export * from "./commands/DescribeNodegroupCommand"; export * from "./commands/DescribeUpdateCommand"; export * from "./commands/ListClustersCommand"; +export * from "./pagination/ListClustersPaginator"; export * from "./commands/ListFargateProfilesCommand"; +export * from "./pagination/ListFargateProfilesPaginator"; export * from "./commands/ListNodegroupsCommand"; +export * from "./pagination/ListNodegroupsPaginator"; export * from "./commands/ListTagsForResourceCommand"; export * from "./commands/ListUpdatesCommand"; +export * from "./pagination/ListUpdatesPaginator"; export * from "./commands/TagResourceCommand"; export * from "./commands/UntagResourceCommand"; export * from "./commands/UpdateClusterConfigCommand"; export * from "./commands/UpdateClusterVersionCommand"; export * from "./commands/UpdateNodegroupConfigCommand"; export * from "./commands/UpdateNodegroupVersionCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-eks/pagination/Interfaces.ts b/clients/client-eks/pagination/Interfaces.ts new file mode 100644 index 0000000000000..996d3ca6257ee --- /dev/null +++ b/clients/client-eks/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { EKS } from "../EKS"; +import { EKSClient } from "../EKSClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface EKSPaginationConfiguration extends PaginationConfiguration { + client: EKS | EKSClient; +} diff --git a/clients/client-eks/pagination/ListClustersPaginator.ts b/clients/client-eks/pagination/ListClustersPaginator.ts new file mode 100644 index 0000000000000..4d87ffea05c8a --- /dev/null +++ b/clients/client-eks/pagination/ListClustersPaginator.ts @@ -0,0 +1,51 @@ +import { EKS } from "../EKS"; +import { EKSClient } from "../EKSClient"; +import { + ListClustersCommand, + ListClustersCommandInput, + ListClustersCommandOutput, +} from "../commands/ListClustersCommand"; +import { EKSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: EKSClient, + input: ListClustersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListClustersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: EKS, + input: ListClustersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listClusters(input, ...args); +}; +export async function* listClustersPaginate( + config: EKSPaginationConfiguration, + input: ListClustersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListClustersCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof EKS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof EKSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected EKS | EKSClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-eks/pagination/ListFargateProfilesPaginator.ts b/clients/client-eks/pagination/ListFargateProfilesPaginator.ts new file mode 100644 index 0000000000000..ff7c020078327 --- /dev/null +++ b/clients/client-eks/pagination/ListFargateProfilesPaginator.ts @@ -0,0 +1,51 @@ +import { EKS } from "../EKS"; +import { EKSClient } from "../EKSClient"; +import { + ListFargateProfilesCommand, + ListFargateProfilesCommandInput, + ListFargateProfilesCommandOutput, +} from "../commands/ListFargateProfilesCommand"; +import { EKSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: EKSClient, + input: ListFargateProfilesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListFargateProfilesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: EKS, + input: ListFargateProfilesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listFargateProfiles(input, ...args); +}; +export async function* listFargateProfilesPaginate( + config: EKSPaginationConfiguration, + input: ListFargateProfilesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListFargateProfilesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof EKS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof EKSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected EKS | EKSClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-eks/pagination/ListNodegroupsPaginator.ts b/clients/client-eks/pagination/ListNodegroupsPaginator.ts new file mode 100644 index 0000000000000..b2f4c4a3d3b34 --- /dev/null +++ b/clients/client-eks/pagination/ListNodegroupsPaginator.ts @@ -0,0 +1,51 @@ +import { EKS } from "../EKS"; +import { EKSClient } from "../EKSClient"; +import { + ListNodegroupsCommand, + ListNodegroupsCommandInput, + ListNodegroupsCommandOutput, +} from "../commands/ListNodegroupsCommand"; +import { EKSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: EKSClient, + input: ListNodegroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListNodegroupsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: EKS, + input: ListNodegroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listNodegroups(input, ...args); +}; +export async function* listNodegroupsPaginate( + config: EKSPaginationConfiguration, + input: ListNodegroupsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListNodegroupsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof EKS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof EKSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected EKS | EKSClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-eks/pagination/ListUpdatesPaginator.ts b/clients/client-eks/pagination/ListUpdatesPaginator.ts new file mode 100644 index 0000000000000..1e26b2b259530 --- /dev/null +++ b/clients/client-eks/pagination/ListUpdatesPaginator.ts @@ -0,0 +1,47 @@ +import { EKS } from "../EKS"; +import { EKSClient } from "../EKSClient"; +import { ListUpdatesCommand, ListUpdatesCommandInput, ListUpdatesCommandOutput } from "../commands/ListUpdatesCommand"; +import { EKSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: EKSClient, + input: ListUpdatesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListUpdatesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: EKS, + input: ListUpdatesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listUpdates(input, ...args); +}; +export async function* listUpdatesPaginate( + config: EKSPaginationConfiguration, + input: ListUpdatesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListUpdatesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof EKS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof EKSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected EKS | EKSClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-elastic-beanstalk/index.ts b/clients/client-elastic-beanstalk/index.ts index 84a05aa5beea0..5c3fdee883b7b 100644 --- a/clients/client-elastic-beanstalk/index.ts +++ b/clients/client-elastic-beanstalk/index.ts @@ -23,16 +23,20 @@ export * from "./commands/DescribeConfigurationOptionsCommand"; export * from "./commands/DescribeConfigurationSettingsCommand"; export * from "./commands/DescribeEnvironmentHealthCommand"; export * from "./commands/DescribeEnvironmentManagedActionHistoryCommand"; +export * from "./pagination/DescribeEnvironmentManagedActionHistoryPaginator"; export * from "./commands/DescribeEnvironmentManagedActionsCommand"; export * from "./commands/DescribeEnvironmentResourcesCommand"; export * from "./commands/DescribeEnvironmentsCommand"; export * from "./commands/DescribeEventsCommand"; +export * from "./pagination/DescribeEventsPaginator"; export * from "./commands/DescribeInstancesHealthCommand"; export * from "./commands/DescribePlatformVersionCommand"; export * from "./commands/DisassociateEnvironmentOperationsRoleCommand"; export * from "./commands/ListAvailableSolutionStacksCommand"; export * from "./commands/ListPlatformBranchesCommand"; +export * from "./pagination/ListPlatformBranchesPaginator"; export * from "./commands/ListPlatformVersionsCommand"; +export * from "./pagination/ListPlatformVersionsPaginator"; export * from "./commands/ListTagsForResourceCommand"; export * from "./commands/RebuildEnvironmentCommand"; export * from "./commands/RequestEnvironmentInfoCommand"; @@ -47,4 +51,5 @@ export * from "./commands/UpdateConfigurationTemplateCommand"; export * from "./commands/UpdateEnvironmentCommand"; export * from "./commands/UpdateTagsForResourceCommand"; export * from "./commands/ValidateConfigurationSettingsCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-elastic-beanstalk/pagination/DescribeEnvironmentManagedActionHistoryPaginator.ts b/clients/client-elastic-beanstalk/pagination/DescribeEnvironmentManagedActionHistoryPaginator.ts new file mode 100644 index 0000000000000..024a23f4e31f3 --- /dev/null +++ b/clients/client-elastic-beanstalk/pagination/DescribeEnvironmentManagedActionHistoryPaginator.ts @@ -0,0 +1,51 @@ +import { ElasticBeanstalk } from "../ElasticBeanstalk"; +import { ElasticBeanstalkClient } from "../ElasticBeanstalkClient"; +import { + DescribeEnvironmentManagedActionHistoryCommand, + DescribeEnvironmentManagedActionHistoryCommandInput, + DescribeEnvironmentManagedActionHistoryCommandOutput, +} from "../commands/DescribeEnvironmentManagedActionHistoryCommand"; +import { ElasticBeanstalkPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ElasticBeanstalkClient, + input: DescribeEnvironmentManagedActionHistoryCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeEnvironmentManagedActionHistoryCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ElasticBeanstalk, + input: DescribeEnvironmentManagedActionHistoryCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeEnvironmentManagedActionHistory(input, ...args); +}; +export async function* describeEnvironmentManagedActionHistoryPaginate( + config: ElasticBeanstalkPaginationConfiguration, + input: DescribeEnvironmentManagedActionHistoryCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeEnvironmentManagedActionHistoryCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxItems"] = config.pageSize; + if (config.client instanceof ElasticBeanstalk) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ElasticBeanstalkClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ElasticBeanstalk | ElasticBeanstalkClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-elastic-beanstalk/pagination/DescribeEventsPaginator.ts b/clients/client-elastic-beanstalk/pagination/DescribeEventsPaginator.ts new file mode 100644 index 0000000000000..f3ea5f1525647 --- /dev/null +++ b/clients/client-elastic-beanstalk/pagination/DescribeEventsPaginator.ts @@ -0,0 +1,51 @@ +import { ElasticBeanstalk } from "../ElasticBeanstalk"; +import { ElasticBeanstalkClient } from "../ElasticBeanstalkClient"; +import { + DescribeEventsCommand, + DescribeEventsCommandInput, + DescribeEventsCommandOutput, +} from "../commands/DescribeEventsCommand"; +import { ElasticBeanstalkPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ElasticBeanstalkClient, + input: DescribeEventsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeEventsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ElasticBeanstalk, + input: DescribeEventsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeEvents(input, ...args); +}; +export async function* describeEventsPaginate( + config: ElasticBeanstalkPaginationConfiguration, + input: DescribeEventsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeEventsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof ElasticBeanstalk) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ElasticBeanstalkClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ElasticBeanstalk | ElasticBeanstalkClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-elastic-beanstalk/pagination/Interfaces.ts b/clients/client-elastic-beanstalk/pagination/Interfaces.ts new file mode 100644 index 0000000000000..8092da2a57cdc --- /dev/null +++ b/clients/client-elastic-beanstalk/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { ElasticBeanstalk } from "../ElasticBeanstalk"; +import { ElasticBeanstalkClient } from "../ElasticBeanstalkClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface ElasticBeanstalkPaginationConfiguration extends PaginationConfiguration { + client: ElasticBeanstalk | ElasticBeanstalkClient; +} diff --git a/clients/client-elastic-beanstalk/pagination/ListPlatformBranchesPaginator.ts b/clients/client-elastic-beanstalk/pagination/ListPlatformBranchesPaginator.ts new file mode 100644 index 0000000000000..095b64f0364e6 --- /dev/null +++ b/clients/client-elastic-beanstalk/pagination/ListPlatformBranchesPaginator.ts @@ -0,0 +1,51 @@ +import { ElasticBeanstalk } from "../ElasticBeanstalk"; +import { ElasticBeanstalkClient } from "../ElasticBeanstalkClient"; +import { + ListPlatformBranchesCommand, + ListPlatformBranchesCommandInput, + ListPlatformBranchesCommandOutput, +} from "../commands/ListPlatformBranchesCommand"; +import { ElasticBeanstalkPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ElasticBeanstalkClient, + input: ListPlatformBranchesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListPlatformBranchesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ElasticBeanstalk, + input: ListPlatformBranchesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listPlatformBranches(input, ...args); +}; +export async function* listPlatformBranchesPaginate( + config: ElasticBeanstalkPaginationConfiguration, + input: ListPlatformBranchesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListPlatformBranchesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof ElasticBeanstalk) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ElasticBeanstalkClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ElasticBeanstalk | ElasticBeanstalkClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-elastic-beanstalk/pagination/ListPlatformVersionsPaginator.ts b/clients/client-elastic-beanstalk/pagination/ListPlatformVersionsPaginator.ts new file mode 100644 index 0000000000000..5789cf91515c2 --- /dev/null +++ b/clients/client-elastic-beanstalk/pagination/ListPlatformVersionsPaginator.ts @@ -0,0 +1,51 @@ +import { ElasticBeanstalk } from "../ElasticBeanstalk"; +import { ElasticBeanstalkClient } from "../ElasticBeanstalkClient"; +import { + ListPlatformVersionsCommand, + ListPlatformVersionsCommandInput, + ListPlatformVersionsCommandOutput, +} from "../commands/ListPlatformVersionsCommand"; +import { ElasticBeanstalkPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ElasticBeanstalkClient, + input: ListPlatformVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListPlatformVersionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ElasticBeanstalk, + input: ListPlatformVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listPlatformVersions(input, ...args); +}; +export async function* listPlatformVersionsPaginate( + config: ElasticBeanstalkPaginationConfiguration, + input: ListPlatformVersionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListPlatformVersionsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof ElasticBeanstalk) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ElasticBeanstalkClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ElasticBeanstalk | ElasticBeanstalkClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-elastic-inference/index.ts b/clients/client-elastic-inference/index.ts index 613bf1e2ece8a..88176d805e6be 100644 --- a/clients/client-elastic-inference/index.ts +++ b/clients/client-elastic-inference/index.ts @@ -2,8 +2,10 @@ export * from "./ElasticInferenceClient"; export * from "./ElasticInference"; export * from "./commands/DescribeAcceleratorOfferingsCommand"; export * from "./commands/DescribeAcceleratorsCommand"; +export * from "./pagination/DescribeAcceleratorsPaginator"; export * from "./commands/DescribeAcceleratorTypesCommand"; export * from "./commands/ListTagsForResourceCommand"; export * from "./commands/TagResourceCommand"; export * from "./commands/UntagResourceCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-elastic-inference/pagination/DescribeAcceleratorsPaginator.ts b/clients/client-elastic-inference/pagination/DescribeAcceleratorsPaginator.ts new file mode 100644 index 0000000000000..2284a66ffc544 --- /dev/null +++ b/clients/client-elastic-inference/pagination/DescribeAcceleratorsPaginator.ts @@ -0,0 +1,51 @@ +import { ElasticInference } from "../ElasticInference"; +import { ElasticInferenceClient } from "../ElasticInferenceClient"; +import { + DescribeAcceleratorsCommand, + DescribeAcceleratorsCommandInput, + DescribeAcceleratorsCommandOutput, +} from "../commands/DescribeAcceleratorsCommand"; +import { ElasticInferencePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ElasticInferenceClient, + input: DescribeAcceleratorsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeAcceleratorsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ElasticInference, + input: DescribeAcceleratorsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeAccelerators(input, ...args); +}; +export async function* describeAcceleratorsPaginate( + config: ElasticInferencePaginationConfiguration, + input: DescribeAcceleratorsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeAcceleratorsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof ElasticInference) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ElasticInferenceClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ElasticInference | ElasticInferenceClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-elastic-inference/pagination/Interfaces.ts b/clients/client-elastic-inference/pagination/Interfaces.ts new file mode 100644 index 0000000000000..a55bc25aca98a --- /dev/null +++ b/clients/client-elastic-inference/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { ElasticInference } from "../ElasticInference"; +import { ElasticInferenceClient } from "../ElasticInferenceClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface ElasticInferencePaginationConfiguration extends PaginationConfiguration { + client: ElasticInference | ElasticInferenceClient; +} diff --git a/clients/client-elastic-load-balancing-v2/index.ts b/clients/client-elastic-load-balancing-v2/index.ts index cd7992f5b55d2..1877ed75779f9 100644 --- a/clients/client-elastic-load-balancing-v2/index.ts +++ b/clients/client-elastic-load-balancing-v2/index.ts @@ -14,13 +14,16 @@ export * from "./commands/DeregisterTargetsCommand"; export * from "./commands/DescribeAccountLimitsCommand"; export * from "./commands/DescribeListenerCertificatesCommand"; export * from "./commands/DescribeListenersCommand"; +export * from "./pagination/DescribeListenersPaginator"; export * from "./commands/DescribeLoadBalancerAttributesCommand"; export * from "./commands/DescribeLoadBalancersCommand"; +export * from "./pagination/DescribeLoadBalancersPaginator"; export * from "./commands/DescribeRulesCommand"; export * from "./commands/DescribeSSLPoliciesCommand"; export * from "./commands/DescribeTagsCommand"; export * from "./commands/DescribeTargetGroupAttributesCommand"; export * from "./commands/DescribeTargetGroupsCommand"; +export * from "./pagination/DescribeTargetGroupsPaginator"; export * from "./commands/DescribeTargetHealthCommand"; export * from "./commands/ModifyListenerCommand"; export * from "./commands/ModifyLoadBalancerAttributesCommand"; @@ -34,4 +37,5 @@ export * from "./commands/SetIpAddressTypeCommand"; export * from "./commands/SetRulePrioritiesCommand"; export * from "./commands/SetSecurityGroupsCommand"; export * from "./commands/SetSubnetsCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-elastic-load-balancing-v2/pagination/DescribeListenersPaginator.ts b/clients/client-elastic-load-balancing-v2/pagination/DescribeListenersPaginator.ts new file mode 100644 index 0000000000000..8f85cd2839f2d --- /dev/null +++ b/clients/client-elastic-load-balancing-v2/pagination/DescribeListenersPaginator.ts @@ -0,0 +1,50 @@ +import { ElasticLoadBalancingV2 } from "../ElasticLoadBalancingV2"; +import { ElasticLoadBalancingV2Client } from "../ElasticLoadBalancingV2Client"; +import { + DescribeListenersCommand, + DescribeListenersCommandInput, + DescribeListenersCommandOutput, +} from "../commands/DescribeListenersCommand"; +import { ElasticLoadBalancingV2PaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ElasticLoadBalancingV2Client, + input: DescribeListenersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeListenersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ElasticLoadBalancingV2, + input: DescribeListenersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeListeners(input, ...args); +}; +export async function* describeListenersPaginate( + config: ElasticLoadBalancingV2PaginationConfiguration, + input: DescribeListenersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeListenersCommandOutput; + while (hasNext) { + input["Marker"] = token; + if (config.client instanceof ElasticLoadBalancingV2) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ElasticLoadBalancingV2Client) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ElasticLoadBalancingV2 | ElasticLoadBalancingV2Client"); + } + yield page; + token = page["NextMarker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-elastic-load-balancing-v2/pagination/DescribeLoadBalancersPaginator.ts b/clients/client-elastic-load-balancing-v2/pagination/DescribeLoadBalancersPaginator.ts new file mode 100644 index 0000000000000..8bb7831a977e5 --- /dev/null +++ b/clients/client-elastic-load-balancing-v2/pagination/DescribeLoadBalancersPaginator.ts @@ -0,0 +1,50 @@ +import { ElasticLoadBalancingV2 } from "../ElasticLoadBalancingV2"; +import { ElasticLoadBalancingV2Client } from "../ElasticLoadBalancingV2Client"; +import { + DescribeLoadBalancersCommand, + DescribeLoadBalancersCommandInput, + DescribeLoadBalancersCommandOutput, +} from "../commands/DescribeLoadBalancersCommand"; +import { ElasticLoadBalancingV2PaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ElasticLoadBalancingV2Client, + input: DescribeLoadBalancersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeLoadBalancersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ElasticLoadBalancingV2, + input: DescribeLoadBalancersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeLoadBalancers(input, ...args); +}; +export async function* describeLoadBalancersPaginate( + config: ElasticLoadBalancingV2PaginationConfiguration, + input: DescribeLoadBalancersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeLoadBalancersCommandOutput; + while (hasNext) { + input["Marker"] = token; + if (config.client instanceof ElasticLoadBalancingV2) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ElasticLoadBalancingV2Client) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ElasticLoadBalancingV2 | ElasticLoadBalancingV2Client"); + } + yield page; + token = page["NextMarker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-elastic-load-balancing-v2/pagination/DescribeTargetGroupsPaginator.ts b/clients/client-elastic-load-balancing-v2/pagination/DescribeTargetGroupsPaginator.ts new file mode 100644 index 0000000000000..87cab86e3d1ef --- /dev/null +++ b/clients/client-elastic-load-balancing-v2/pagination/DescribeTargetGroupsPaginator.ts @@ -0,0 +1,50 @@ +import { ElasticLoadBalancingV2 } from "../ElasticLoadBalancingV2"; +import { ElasticLoadBalancingV2Client } from "../ElasticLoadBalancingV2Client"; +import { + DescribeTargetGroupsCommand, + DescribeTargetGroupsCommandInput, + DescribeTargetGroupsCommandOutput, +} from "../commands/DescribeTargetGroupsCommand"; +import { ElasticLoadBalancingV2PaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ElasticLoadBalancingV2Client, + input: DescribeTargetGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeTargetGroupsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ElasticLoadBalancingV2, + input: DescribeTargetGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeTargetGroups(input, ...args); +}; +export async function* describeTargetGroupsPaginate( + config: ElasticLoadBalancingV2PaginationConfiguration, + input: DescribeTargetGroupsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeTargetGroupsCommandOutput; + while (hasNext) { + input["Marker"] = token; + if (config.client instanceof ElasticLoadBalancingV2) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ElasticLoadBalancingV2Client) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ElasticLoadBalancingV2 | ElasticLoadBalancingV2Client"); + } + yield page; + token = page["NextMarker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-elastic-load-balancing-v2/pagination/Interfaces.ts b/clients/client-elastic-load-balancing-v2/pagination/Interfaces.ts new file mode 100644 index 0000000000000..8952ef5b8b858 --- /dev/null +++ b/clients/client-elastic-load-balancing-v2/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { ElasticLoadBalancingV2 } from "../ElasticLoadBalancingV2"; +import { ElasticLoadBalancingV2Client } from "../ElasticLoadBalancingV2Client"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface ElasticLoadBalancingV2PaginationConfiguration extends PaginationConfiguration { + client: ElasticLoadBalancingV2 | ElasticLoadBalancingV2Client; +} diff --git a/clients/client-elastic-load-balancing/index.ts b/clients/client-elastic-load-balancing/index.ts index 4fc0e6ab2e856..22fa66096b627 100644 --- a/clients/client-elastic-load-balancing/index.ts +++ b/clients/client-elastic-load-balancing/index.ts @@ -19,6 +19,7 @@ export * from "./commands/DescribeLoadBalancerAttributesCommand"; export * from "./commands/DescribeLoadBalancerPoliciesCommand"; export * from "./commands/DescribeLoadBalancerPolicyTypesCommand"; export * from "./commands/DescribeLoadBalancersCommand"; +export * from "./pagination/DescribeLoadBalancersPaginator"; export * from "./commands/DescribeTagsCommand"; export * from "./commands/DetachLoadBalancerFromSubnetsCommand"; export * from "./commands/DisableAvailabilityZonesForLoadBalancerCommand"; @@ -29,4 +30,5 @@ export * from "./commands/RemoveTagsCommand"; export * from "./commands/SetLoadBalancerListenerSSLCertificateCommand"; export * from "./commands/SetLoadBalancerPoliciesForBackendServerCommand"; export * from "./commands/SetLoadBalancerPoliciesOfListenerCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-elastic-load-balancing/pagination/DescribeLoadBalancersPaginator.ts b/clients/client-elastic-load-balancing/pagination/DescribeLoadBalancersPaginator.ts new file mode 100644 index 0000000000000..c0f789abb19b7 --- /dev/null +++ b/clients/client-elastic-load-balancing/pagination/DescribeLoadBalancersPaginator.ts @@ -0,0 +1,50 @@ +import { ElasticLoadBalancing } from "../ElasticLoadBalancing"; +import { ElasticLoadBalancingClient } from "../ElasticLoadBalancingClient"; +import { + DescribeLoadBalancersCommand, + DescribeLoadBalancersCommandInput, + DescribeLoadBalancersCommandOutput, +} from "../commands/DescribeLoadBalancersCommand"; +import { ElasticLoadBalancingPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ElasticLoadBalancingClient, + input: DescribeLoadBalancersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeLoadBalancersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ElasticLoadBalancing, + input: DescribeLoadBalancersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeLoadBalancers(input, ...args); +}; +export async function* describeLoadBalancersPaginate( + config: ElasticLoadBalancingPaginationConfiguration, + input: DescribeLoadBalancersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeLoadBalancersCommandOutput; + while (hasNext) { + input["Marker"] = token; + if (config.client instanceof ElasticLoadBalancing) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ElasticLoadBalancingClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ElasticLoadBalancing | ElasticLoadBalancingClient"); + } + yield page; + token = page["NextMarker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-elastic-load-balancing/pagination/Interfaces.ts b/clients/client-elastic-load-balancing/pagination/Interfaces.ts new file mode 100644 index 0000000000000..f8e186ccbe71d --- /dev/null +++ b/clients/client-elastic-load-balancing/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { ElasticLoadBalancing } from "../ElasticLoadBalancing"; +import { ElasticLoadBalancingClient } from "../ElasticLoadBalancingClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface ElasticLoadBalancingPaginationConfiguration extends PaginationConfiguration { + client: ElasticLoadBalancing | ElasticLoadBalancingClient; +} diff --git a/clients/client-elastic-transcoder/index.ts b/clients/client-elastic-transcoder/index.ts index 832a6bc257c73..f8c5bae535e92 100644 --- a/clients/client-elastic-transcoder/index.ts +++ b/clients/client-elastic-transcoder/index.ts @@ -7,9 +7,13 @@ export * from "./commands/CreatePresetCommand"; export * from "./commands/DeletePipelineCommand"; export * from "./commands/DeletePresetCommand"; export * from "./commands/ListJobsByPipelineCommand"; +export * from "./pagination/ListJobsByPipelinePaginator"; export * from "./commands/ListJobsByStatusCommand"; +export * from "./pagination/ListJobsByStatusPaginator"; export * from "./commands/ListPipelinesCommand"; +export * from "./pagination/ListPipelinesPaginator"; export * from "./commands/ListPresetsCommand"; +export * from "./pagination/ListPresetsPaginator"; export * from "./commands/ReadJobCommand"; export * from "./commands/ReadPipelineCommand"; export * from "./commands/ReadPresetCommand"; @@ -17,4 +21,5 @@ export * from "./commands/TestRoleCommand"; export * from "./commands/UpdatePipelineCommand"; export * from "./commands/UpdatePipelineNotificationsCommand"; export * from "./commands/UpdatePipelineStatusCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-elastic-transcoder/pagination/Interfaces.ts b/clients/client-elastic-transcoder/pagination/Interfaces.ts new file mode 100644 index 0000000000000..6690d42d81829 --- /dev/null +++ b/clients/client-elastic-transcoder/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { ElasticTranscoder } from "../ElasticTranscoder"; +import { ElasticTranscoderClient } from "../ElasticTranscoderClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface ElasticTranscoderPaginationConfiguration extends PaginationConfiguration { + client: ElasticTranscoder | ElasticTranscoderClient; +} diff --git a/clients/client-elastic-transcoder/pagination/ListJobsByPipelinePaginator.ts b/clients/client-elastic-transcoder/pagination/ListJobsByPipelinePaginator.ts new file mode 100644 index 0000000000000..7820b7f93035b --- /dev/null +++ b/clients/client-elastic-transcoder/pagination/ListJobsByPipelinePaginator.ts @@ -0,0 +1,50 @@ +import { ElasticTranscoder } from "../ElasticTranscoder"; +import { ElasticTranscoderClient } from "../ElasticTranscoderClient"; +import { + ListJobsByPipelineCommand, + ListJobsByPipelineCommandInput, + ListJobsByPipelineCommandOutput, +} from "../commands/ListJobsByPipelineCommand"; +import { ElasticTranscoderPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ElasticTranscoderClient, + input: ListJobsByPipelineCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListJobsByPipelineCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ElasticTranscoder, + input: ListJobsByPipelineCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listJobsByPipeline(input, ...args); +}; +export async function* listJobsByPipelinePaginate( + config: ElasticTranscoderPaginationConfiguration, + input: ListJobsByPipelineCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListJobsByPipelineCommandOutput; + while (hasNext) { + input["PageToken"] = token; + if (config.client instanceof ElasticTranscoder) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ElasticTranscoderClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ElasticTranscoder | ElasticTranscoderClient"); + } + yield page; + token = page["NextPageToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-elastic-transcoder/pagination/ListJobsByStatusPaginator.ts b/clients/client-elastic-transcoder/pagination/ListJobsByStatusPaginator.ts new file mode 100644 index 0000000000000..454424bc76edf --- /dev/null +++ b/clients/client-elastic-transcoder/pagination/ListJobsByStatusPaginator.ts @@ -0,0 +1,50 @@ +import { ElasticTranscoder } from "../ElasticTranscoder"; +import { ElasticTranscoderClient } from "../ElasticTranscoderClient"; +import { + ListJobsByStatusCommand, + ListJobsByStatusCommandInput, + ListJobsByStatusCommandOutput, +} from "../commands/ListJobsByStatusCommand"; +import { ElasticTranscoderPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ElasticTranscoderClient, + input: ListJobsByStatusCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListJobsByStatusCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ElasticTranscoder, + input: ListJobsByStatusCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listJobsByStatus(input, ...args); +}; +export async function* listJobsByStatusPaginate( + config: ElasticTranscoderPaginationConfiguration, + input: ListJobsByStatusCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListJobsByStatusCommandOutput; + while (hasNext) { + input["PageToken"] = token; + if (config.client instanceof ElasticTranscoder) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ElasticTranscoderClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ElasticTranscoder | ElasticTranscoderClient"); + } + yield page; + token = page["NextPageToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-elastic-transcoder/pagination/ListPipelinesPaginator.ts b/clients/client-elastic-transcoder/pagination/ListPipelinesPaginator.ts new file mode 100644 index 0000000000000..5e566a1e7c4e7 --- /dev/null +++ b/clients/client-elastic-transcoder/pagination/ListPipelinesPaginator.ts @@ -0,0 +1,50 @@ +import { ElasticTranscoder } from "../ElasticTranscoder"; +import { ElasticTranscoderClient } from "../ElasticTranscoderClient"; +import { + ListPipelinesCommand, + ListPipelinesCommandInput, + ListPipelinesCommandOutput, +} from "../commands/ListPipelinesCommand"; +import { ElasticTranscoderPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ElasticTranscoderClient, + input: ListPipelinesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListPipelinesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ElasticTranscoder, + input: ListPipelinesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listPipelines(input, ...args); +}; +export async function* listPipelinesPaginate( + config: ElasticTranscoderPaginationConfiguration, + input: ListPipelinesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListPipelinesCommandOutput; + while (hasNext) { + input["PageToken"] = token; + if (config.client instanceof ElasticTranscoder) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ElasticTranscoderClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ElasticTranscoder | ElasticTranscoderClient"); + } + yield page; + token = page["NextPageToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-elastic-transcoder/pagination/ListPresetsPaginator.ts b/clients/client-elastic-transcoder/pagination/ListPresetsPaginator.ts new file mode 100644 index 0000000000000..d930f6a5b87a3 --- /dev/null +++ b/clients/client-elastic-transcoder/pagination/ListPresetsPaginator.ts @@ -0,0 +1,46 @@ +import { ElasticTranscoder } from "../ElasticTranscoder"; +import { ElasticTranscoderClient } from "../ElasticTranscoderClient"; +import { ListPresetsCommand, ListPresetsCommandInput, ListPresetsCommandOutput } from "../commands/ListPresetsCommand"; +import { ElasticTranscoderPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ElasticTranscoderClient, + input: ListPresetsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListPresetsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ElasticTranscoder, + input: ListPresetsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listPresets(input, ...args); +}; +export async function* listPresetsPaginate( + config: ElasticTranscoderPaginationConfiguration, + input: ListPresetsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListPresetsCommandOutput; + while (hasNext) { + input["PageToken"] = token; + if (config.client instanceof ElasticTranscoder) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ElasticTranscoderClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ElasticTranscoder | ElasticTranscoderClient"); + } + yield page; + token = page["NextPageToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-elasticache/index.ts b/clients/client-elasticache/index.ts index d7dc97fbc5bdc..9e51254242d6c 100644 --- a/clients/client-elasticache/index.ts +++ b/clients/client-elasticache/index.ts @@ -23,20 +23,34 @@ export * from "./commands/DeleteGlobalReplicationGroupCommand"; export * from "./commands/DeleteReplicationGroupCommand"; export * from "./commands/DeleteSnapshotCommand"; export * from "./commands/DescribeCacheClustersCommand"; +export * from "./pagination/DescribeCacheClustersPaginator"; export * from "./commands/DescribeCacheEngineVersionsCommand"; +export * from "./pagination/DescribeCacheEngineVersionsPaginator"; export * from "./commands/DescribeCacheParameterGroupsCommand"; +export * from "./pagination/DescribeCacheParameterGroupsPaginator"; export * from "./commands/DescribeCacheParametersCommand"; +export * from "./pagination/DescribeCacheParametersPaginator"; export * from "./commands/DescribeCacheSecurityGroupsCommand"; +export * from "./pagination/DescribeCacheSecurityGroupsPaginator"; export * from "./commands/DescribeCacheSubnetGroupsCommand"; +export * from "./pagination/DescribeCacheSubnetGroupsPaginator"; export * from "./commands/DescribeEngineDefaultParametersCommand"; export * from "./commands/DescribeEventsCommand"; +export * from "./pagination/DescribeEventsPaginator"; export * from "./commands/DescribeGlobalReplicationGroupsCommand"; +export * from "./pagination/DescribeGlobalReplicationGroupsPaginator"; export * from "./commands/DescribeReplicationGroupsCommand"; +export * from "./pagination/DescribeReplicationGroupsPaginator"; export * from "./commands/DescribeReservedCacheNodesCommand"; +export * from "./pagination/DescribeReservedCacheNodesPaginator"; export * from "./commands/DescribeReservedCacheNodesOfferingsCommand"; +export * from "./pagination/DescribeReservedCacheNodesOfferingsPaginator"; export * from "./commands/DescribeServiceUpdatesCommand"; +export * from "./pagination/DescribeServiceUpdatesPaginator"; export * from "./commands/DescribeSnapshotsCommand"; +export * from "./pagination/DescribeSnapshotsPaginator"; export * from "./commands/DescribeUpdateActionsCommand"; +export * from "./pagination/DescribeUpdateActionsPaginator"; export * from "./commands/DisassociateGlobalReplicationGroupCommand"; export * from "./commands/FailoverGlobalReplicationGroupCommand"; export * from "./commands/IncreaseNodeGroupsInGlobalReplicationGroupCommand"; @@ -57,4 +71,5 @@ export * from "./commands/ResetCacheParameterGroupCommand"; export * from "./commands/RevokeCacheSecurityGroupIngressCommand"; export * from "./commands/StartMigrationCommand"; export * from "./commands/TestFailoverCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-elasticache/pagination/DescribeCacheClustersPaginator.ts b/clients/client-elasticache/pagination/DescribeCacheClustersPaginator.ts new file mode 100644 index 0000000000000..6bd470b3cd96a --- /dev/null +++ b/clients/client-elasticache/pagination/DescribeCacheClustersPaginator.ts @@ -0,0 +1,51 @@ +import { ElastiCache } from "../ElastiCache"; +import { ElastiCacheClient } from "../ElastiCacheClient"; +import { + DescribeCacheClustersCommand, + DescribeCacheClustersCommandInput, + DescribeCacheClustersCommandOutput, +} from "../commands/DescribeCacheClustersCommand"; +import { ElastiCachePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ElastiCacheClient, + input: DescribeCacheClustersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeCacheClustersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ElastiCache, + input: DescribeCacheClustersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeCacheClusters(input, ...args); +}; +export async function* describeCacheClustersPaginate( + config: ElastiCachePaginationConfiguration, + input: DescribeCacheClustersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeCacheClustersCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof ElastiCache) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ElastiCacheClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ElastiCache | ElastiCacheClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-elasticache/pagination/DescribeCacheEngineVersionsPaginator.ts b/clients/client-elasticache/pagination/DescribeCacheEngineVersionsPaginator.ts new file mode 100644 index 0000000000000..196fbadbd9cec --- /dev/null +++ b/clients/client-elasticache/pagination/DescribeCacheEngineVersionsPaginator.ts @@ -0,0 +1,51 @@ +import { ElastiCache } from "../ElastiCache"; +import { ElastiCacheClient } from "../ElastiCacheClient"; +import { + DescribeCacheEngineVersionsCommand, + DescribeCacheEngineVersionsCommandInput, + DescribeCacheEngineVersionsCommandOutput, +} from "../commands/DescribeCacheEngineVersionsCommand"; +import { ElastiCachePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ElastiCacheClient, + input: DescribeCacheEngineVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeCacheEngineVersionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ElastiCache, + input: DescribeCacheEngineVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeCacheEngineVersions(input, ...args); +}; +export async function* describeCacheEngineVersionsPaginate( + config: ElastiCachePaginationConfiguration, + input: DescribeCacheEngineVersionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeCacheEngineVersionsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof ElastiCache) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ElastiCacheClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ElastiCache | ElastiCacheClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-elasticache/pagination/DescribeCacheParameterGroupsPaginator.ts b/clients/client-elasticache/pagination/DescribeCacheParameterGroupsPaginator.ts new file mode 100644 index 0000000000000..fc5ba30760749 --- /dev/null +++ b/clients/client-elasticache/pagination/DescribeCacheParameterGroupsPaginator.ts @@ -0,0 +1,51 @@ +import { ElastiCache } from "../ElastiCache"; +import { ElastiCacheClient } from "../ElastiCacheClient"; +import { + DescribeCacheParameterGroupsCommand, + DescribeCacheParameterGroupsCommandInput, + DescribeCacheParameterGroupsCommandOutput, +} from "../commands/DescribeCacheParameterGroupsCommand"; +import { ElastiCachePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ElastiCacheClient, + input: DescribeCacheParameterGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeCacheParameterGroupsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ElastiCache, + input: DescribeCacheParameterGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeCacheParameterGroups(input, ...args); +}; +export async function* describeCacheParameterGroupsPaginate( + config: ElastiCachePaginationConfiguration, + input: DescribeCacheParameterGroupsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeCacheParameterGroupsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof ElastiCache) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ElastiCacheClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ElastiCache | ElastiCacheClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-elasticache/pagination/DescribeCacheParametersPaginator.ts b/clients/client-elasticache/pagination/DescribeCacheParametersPaginator.ts new file mode 100644 index 0000000000000..4ffd5980f1528 --- /dev/null +++ b/clients/client-elasticache/pagination/DescribeCacheParametersPaginator.ts @@ -0,0 +1,51 @@ +import { ElastiCache } from "../ElastiCache"; +import { ElastiCacheClient } from "../ElastiCacheClient"; +import { + DescribeCacheParametersCommand, + DescribeCacheParametersCommandInput, + DescribeCacheParametersCommandOutput, +} from "../commands/DescribeCacheParametersCommand"; +import { ElastiCachePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ElastiCacheClient, + input: DescribeCacheParametersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeCacheParametersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ElastiCache, + input: DescribeCacheParametersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeCacheParameters(input, ...args); +}; +export async function* describeCacheParametersPaginate( + config: ElastiCachePaginationConfiguration, + input: DescribeCacheParametersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeCacheParametersCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof ElastiCache) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ElastiCacheClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ElastiCache | ElastiCacheClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-elasticache/pagination/DescribeCacheSecurityGroupsPaginator.ts b/clients/client-elasticache/pagination/DescribeCacheSecurityGroupsPaginator.ts new file mode 100644 index 0000000000000..4ca2b2493e296 --- /dev/null +++ b/clients/client-elasticache/pagination/DescribeCacheSecurityGroupsPaginator.ts @@ -0,0 +1,51 @@ +import { ElastiCache } from "../ElastiCache"; +import { ElastiCacheClient } from "../ElastiCacheClient"; +import { + DescribeCacheSecurityGroupsCommand, + DescribeCacheSecurityGroupsCommandInput, + DescribeCacheSecurityGroupsCommandOutput, +} from "../commands/DescribeCacheSecurityGroupsCommand"; +import { ElastiCachePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ElastiCacheClient, + input: DescribeCacheSecurityGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeCacheSecurityGroupsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ElastiCache, + input: DescribeCacheSecurityGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeCacheSecurityGroups(input, ...args); +}; +export async function* describeCacheSecurityGroupsPaginate( + config: ElastiCachePaginationConfiguration, + input: DescribeCacheSecurityGroupsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeCacheSecurityGroupsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof ElastiCache) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ElastiCacheClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ElastiCache | ElastiCacheClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-elasticache/pagination/DescribeCacheSubnetGroupsPaginator.ts b/clients/client-elasticache/pagination/DescribeCacheSubnetGroupsPaginator.ts new file mode 100644 index 0000000000000..37fc77641f5e2 --- /dev/null +++ b/clients/client-elasticache/pagination/DescribeCacheSubnetGroupsPaginator.ts @@ -0,0 +1,51 @@ +import { ElastiCache } from "../ElastiCache"; +import { ElastiCacheClient } from "../ElastiCacheClient"; +import { + DescribeCacheSubnetGroupsCommand, + DescribeCacheSubnetGroupsCommandInput, + DescribeCacheSubnetGroupsCommandOutput, +} from "../commands/DescribeCacheSubnetGroupsCommand"; +import { ElastiCachePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ElastiCacheClient, + input: DescribeCacheSubnetGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeCacheSubnetGroupsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ElastiCache, + input: DescribeCacheSubnetGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeCacheSubnetGroups(input, ...args); +}; +export async function* describeCacheSubnetGroupsPaginate( + config: ElastiCachePaginationConfiguration, + input: DescribeCacheSubnetGroupsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeCacheSubnetGroupsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof ElastiCache) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ElastiCacheClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ElastiCache | ElastiCacheClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-elasticache/pagination/DescribeEventsPaginator.ts b/clients/client-elasticache/pagination/DescribeEventsPaginator.ts new file mode 100644 index 0000000000000..6a271e236f717 --- /dev/null +++ b/clients/client-elasticache/pagination/DescribeEventsPaginator.ts @@ -0,0 +1,51 @@ +import { ElastiCache } from "../ElastiCache"; +import { ElastiCacheClient } from "../ElastiCacheClient"; +import { + DescribeEventsCommand, + DescribeEventsCommandInput, + DescribeEventsCommandOutput, +} from "../commands/DescribeEventsCommand"; +import { ElastiCachePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ElastiCacheClient, + input: DescribeEventsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeEventsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ElastiCache, + input: DescribeEventsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeEvents(input, ...args); +}; +export async function* describeEventsPaginate( + config: ElastiCachePaginationConfiguration, + input: DescribeEventsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeEventsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof ElastiCache) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ElastiCacheClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ElastiCache | ElastiCacheClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-elasticache/pagination/DescribeGlobalReplicationGroupsPaginator.ts b/clients/client-elasticache/pagination/DescribeGlobalReplicationGroupsPaginator.ts new file mode 100644 index 0000000000000..f4f1cd299f0b2 --- /dev/null +++ b/clients/client-elasticache/pagination/DescribeGlobalReplicationGroupsPaginator.ts @@ -0,0 +1,51 @@ +import { ElastiCache } from "../ElastiCache"; +import { ElastiCacheClient } from "../ElastiCacheClient"; +import { + DescribeGlobalReplicationGroupsCommand, + DescribeGlobalReplicationGroupsCommandInput, + DescribeGlobalReplicationGroupsCommandOutput, +} from "../commands/DescribeGlobalReplicationGroupsCommand"; +import { ElastiCachePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ElastiCacheClient, + input: DescribeGlobalReplicationGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeGlobalReplicationGroupsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ElastiCache, + input: DescribeGlobalReplicationGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeGlobalReplicationGroups(input, ...args); +}; +export async function* describeGlobalReplicationGroupsPaginate( + config: ElastiCachePaginationConfiguration, + input: DescribeGlobalReplicationGroupsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeGlobalReplicationGroupsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof ElastiCache) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ElastiCacheClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ElastiCache | ElastiCacheClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-elasticache/pagination/DescribeReplicationGroupsPaginator.ts b/clients/client-elasticache/pagination/DescribeReplicationGroupsPaginator.ts new file mode 100644 index 0000000000000..afe41b21485d3 --- /dev/null +++ b/clients/client-elasticache/pagination/DescribeReplicationGroupsPaginator.ts @@ -0,0 +1,51 @@ +import { ElastiCache } from "../ElastiCache"; +import { ElastiCacheClient } from "../ElastiCacheClient"; +import { + DescribeReplicationGroupsCommand, + DescribeReplicationGroupsCommandInput, + DescribeReplicationGroupsCommandOutput, +} from "../commands/DescribeReplicationGroupsCommand"; +import { ElastiCachePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ElastiCacheClient, + input: DescribeReplicationGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeReplicationGroupsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ElastiCache, + input: DescribeReplicationGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeReplicationGroups(input, ...args); +}; +export async function* describeReplicationGroupsPaginate( + config: ElastiCachePaginationConfiguration, + input: DescribeReplicationGroupsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeReplicationGroupsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof ElastiCache) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ElastiCacheClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ElastiCache | ElastiCacheClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-elasticache/pagination/DescribeReservedCacheNodesOfferingsPaginator.ts b/clients/client-elasticache/pagination/DescribeReservedCacheNodesOfferingsPaginator.ts new file mode 100644 index 0000000000000..e1824e6ff30c1 --- /dev/null +++ b/clients/client-elasticache/pagination/DescribeReservedCacheNodesOfferingsPaginator.ts @@ -0,0 +1,51 @@ +import { ElastiCache } from "../ElastiCache"; +import { ElastiCacheClient } from "../ElastiCacheClient"; +import { + DescribeReservedCacheNodesOfferingsCommand, + DescribeReservedCacheNodesOfferingsCommandInput, + DescribeReservedCacheNodesOfferingsCommandOutput, +} from "../commands/DescribeReservedCacheNodesOfferingsCommand"; +import { ElastiCachePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ElastiCacheClient, + input: DescribeReservedCacheNodesOfferingsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeReservedCacheNodesOfferingsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ElastiCache, + input: DescribeReservedCacheNodesOfferingsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeReservedCacheNodesOfferings(input, ...args); +}; +export async function* describeReservedCacheNodesOfferingsPaginate( + config: ElastiCachePaginationConfiguration, + input: DescribeReservedCacheNodesOfferingsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeReservedCacheNodesOfferingsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof ElastiCache) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ElastiCacheClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ElastiCache | ElastiCacheClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-elasticache/pagination/DescribeReservedCacheNodesPaginator.ts b/clients/client-elasticache/pagination/DescribeReservedCacheNodesPaginator.ts new file mode 100644 index 0000000000000..99ea5b05baeb3 --- /dev/null +++ b/clients/client-elasticache/pagination/DescribeReservedCacheNodesPaginator.ts @@ -0,0 +1,51 @@ +import { ElastiCache } from "../ElastiCache"; +import { ElastiCacheClient } from "../ElastiCacheClient"; +import { + DescribeReservedCacheNodesCommand, + DescribeReservedCacheNodesCommandInput, + DescribeReservedCacheNodesCommandOutput, +} from "../commands/DescribeReservedCacheNodesCommand"; +import { ElastiCachePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ElastiCacheClient, + input: DescribeReservedCacheNodesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeReservedCacheNodesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ElastiCache, + input: DescribeReservedCacheNodesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeReservedCacheNodes(input, ...args); +}; +export async function* describeReservedCacheNodesPaginate( + config: ElastiCachePaginationConfiguration, + input: DescribeReservedCacheNodesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeReservedCacheNodesCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof ElastiCache) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ElastiCacheClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ElastiCache | ElastiCacheClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-elasticache/pagination/DescribeServiceUpdatesPaginator.ts b/clients/client-elasticache/pagination/DescribeServiceUpdatesPaginator.ts new file mode 100644 index 0000000000000..ed7e081b5366f --- /dev/null +++ b/clients/client-elasticache/pagination/DescribeServiceUpdatesPaginator.ts @@ -0,0 +1,51 @@ +import { ElastiCache } from "../ElastiCache"; +import { ElastiCacheClient } from "../ElastiCacheClient"; +import { + DescribeServiceUpdatesCommand, + DescribeServiceUpdatesCommandInput, + DescribeServiceUpdatesCommandOutput, +} from "../commands/DescribeServiceUpdatesCommand"; +import { ElastiCachePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ElastiCacheClient, + input: DescribeServiceUpdatesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeServiceUpdatesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ElastiCache, + input: DescribeServiceUpdatesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeServiceUpdates(input, ...args); +}; +export async function* describeServiceUpdatesPaginate( + config: ElastiCachePaginationConfiguration, + input: DescribeServiceUpdatesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeServiceUpdatesCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof ElastiCache) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ElastiCacheClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ElastiCache | ElastiCacheClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-elasticache/pagination/DescribeSnapshotsPaginator.ts b/clients/client-elasticache/pagination/DescribeSnapshotsPaginator.ts new file mode 100644 index 0000000000000..8689f1da08dbd --- /dev/null +++ b/clients/client-elasticache/pagination/DescribeSnapshotsPaginator.ts @@ -0,0 +1,51 @@ +import { ElastiCache } from "../ElastiCache"; +import { ElastiCacheClient } from "../ElastiCacheClient"; +import { + DescribeSnapshotsCommand, + DescribeSnapshotsCommandInput, + DescribeSnapshotsCommandOutput, +} from "../commands/DescribeSnapshotsCommand"; +import { ElastiCachePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ElastiCacheClient, + input: DescribeSnapshotsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeSnapshotsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ElastiCache, + input: DescribeSnapshotsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeSnapshots(input, ...args); +}; +export async function* describeSnapshotsPaginate( + config: ElastiCachePaginationConfiguration, + input: DescribeSnapshotsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeSnapshotsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof ElastiCache) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ElastiCacheClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ElastiCache | ElastiCacheClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-elasticache/pagination/DescribeUpdateActionsPaginator.ts b/clients/client-elasticache/pagination/DescribeUpdateActionsPaginator.ts new file mode 100644 index 0000000000000..c2ed15138d14b --- /dev/null +++ b/clients/client-elasticache/pagination/DescribeUpdateActionsPaginator.ts @@ -0,0 +1,51 @@ +import { ElastiCache } from "../ElastiCache"; +import { ElastiCacheClient } from "../ElastiCacheClient"; +import { + DescribeUpdateActionsCommand, + DescribeUpdateActionsCommandInput, + DescribeUpdateActionsCommandOutput, +} from "../commands/DescribeUpdateActionsCommand"; +import { ElastiCachePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ElastiCacheClient, + input: DescribeUpdateActionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeUpdateActionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ElastiCache, + input: DescribeUpdateActionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeUpdateActions(input, ...args); +}; +export async function* describeUpdateActionsPaginate( + config: ElastiCachePaginationConfiguration, + input: DescribeUpdateActionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeUpdateActionsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof ElastiCache) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ElastiCacheClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ElastiCache | ElastiCacheClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-elasticache/pagination/Interfaces.ts b/clients/client-elasticache/pagination/Interfaces.ts new file mode 100644 index 0000000000000..8319eb6d1210e --- /dev/null +++ b/clients/client-elasticache/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { ElastiCache } from "../ElastiCache"; +import { ElastiCacheClient } from "../ElastiCacheClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface ElastiCachePaginationConfiguration extends PaginationConfiguration { + client: ElastiCache | ElastiCacheClient; +} diff --git a/clients/client-elasticsearch-service/index.ts b/clients/client-elasticsearch-service/index.ts index 36a0976a1fa8d..5a440ebc05941 100644 --- a/clients/client-elasticsearch-service/index.ts +++ b/clients/client-elasticsearch-service/index.ts @@ -17,19 +17,29 @@ export * from "./commands/DescribeElasticsearchDomainConfigCommand"; export * from "./commands/DescribeElasticsearchDomainsCommand"; export * from "./commands/DescribeElasticsearchInstanceTypeLimitsCommand"; export * from "./commands/DescribeInboundCrossClusterSearchConnectionsCommand"; +export * from "./pagination/DescribeInboundCrossClusterSearchConnectionsPaginator"; export * from "./commands/DescribeOutboundCrossClusterSearchConnectionsCommand"; +export * from "./pagination/DescribeOutboundCrossClusterSearchConnectionsPaginator"; export * from "./commands/DescribePackagesCommand"; +export * from "./pagination/DescribePackagesPaginator"; export * from "./commands/DescribeReservedElasticsearchInstanceOfferingsCommand"; +export * from "./pagination/DescribeReservedElasticsearchInstanceOfferingsPaginator"; export * from "./commands/DescribeReservedElasticsearchInstancesCommand"; +export * from "./pagination/DescribeReservedElasticsearchInstancesPaginator"; export * from "./commands/DissociatePackageCommand"; export * from "./commands/GetCompatibleElasticsearchVersionsCommand"; export * from "./commands/GetUpgradeHistoryCommand"; +export * from "./pagination/GetUpgradeHistoryPaginator"; export * from "./commands/GetUpgradeStatusCommand"; export * from "./commands/ListDomainNamesCommand"; export * from "./commands/ListDomainsForPackageCommand"; +export * from "./pagination/ListDomainsForPackagePaginator"; export * from "./commands/ListElasticsearchInstanceTypesCommand"; +export * from "./pagination/ListElasticsearchInstanceTypesPaginator"; export * from "./commands/ListElasticsearchVersionsCommand"; +export * from "./pagination/ListElasticsearchVersionsPaginator"; export * from "./commands/ListPackagesForDomainCommand"; +export * from "./pagination/ListPackagesForDomainPaginator"; export * from "./commands/ListTagsCommand"; export * from "./commands/PurchaseReservedElasticsearchInstanceOfferingCommand"; export * from "./commands/RejectInboundCrossClusterSearchConnectionCommand"; @@ -37,4 +47,5 @@ export * from "./commands/RemoveTagsCommand"; export * from "./commands/StartElasticsearchServiceSoftwareUpdateCommand"; export * from "./commands/UpdateElasticsearchDomainConfigCommand"; export * from "./commands/UpgradeElasticsearchDomainCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-elasticsearch-service/pagination/DescribeInboundCrossClusterSearchConnectionsPaginator.ts b/clients/client-elasticsearch-service/pagination/DescribeInboundCrossClusterSearchConnectionsPaginator.ts new file mode 100644 index 0000000000000..591a1872e2f85 --- /dev/null +++ b/clients/client-elasticsearch-service/pagination/DescribeInboundCrossClusterSearchConnectionsPaginator.ts @@ -0,0 +1,51 @@ +import { ElasticsearchService } from "../ElasticsearchService"; +import { ElasticsearchServiceClient } from "../ElasticsearchServiceClient"; +import { + DescribeInboundCrossClusterSearchConnectionsCommand, + DescribeInboundCrossClusterSearchConnectionsCommandInput, + DescribeInboundCrossClusterSearchConnectionsCommandOutput, +} from "../commands/DescribeInboundCrossClusterSearchConnectionsCommand"; +import { ElasticsearchServicePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ElasticsearchServiceClient, + input: DescribeInboundCrossClusterSearchConnectionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeInboundCrossClusterSearchConnectionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ElasticsearchService, + input: DescribeInboundCrossClusterSearchConnectionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeInboundCrossClusterSearchConnections(input, ...args); +}; +export async function* describeInboundCrossClusterSearchConnectionsPaginate( + config: ElasticsearchServicePaginationConfiguration, + input: DescribeInboundCrossClusterSearchConnectionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeInboundCrossClusterSearchConnectionsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof ElasticsearchService) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ElasticsearchServiceClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ElasticsearchService | ElasticsearchServiceClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-elasticsearch-service/pagination/DescribeOutboundCrossClusterSearchConnectionsPaginator.ts b/clients/client-elasticsearch-service/pagination/DescribeOutboundCrossClusterSearchConnectionsPaginator.ts new file mode 100644 index 0000000000000..080c167aea82c --- /dev/null +++ b/clients/client-elasticsearch-service/pagination/DescribeOutboundCrossClusterSearchConnectionsPaginator.ts @@ -0,0 +1,51 @@ +import { ElasticsearchService } from "../ElasticsearchService"; +import { ElasticsearchServiceClient } from "../ElasticsearchServiceClient"; +import { + DescribeOutboundCrossClusterSearchConnectionsCommand, + DescribeOutboundCrossClusterSearchConnectionsCommandInput, + DescribeOutboundCrossClusterSearchConnectionsCommandOutput, +} from "../commands/DescribeOutboundCrossClusterSearchConnectionsCommand"; +import { ElasticsearchServicePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ElasticsearchServiceClient, + input: DescribeOutboundCrossClusterSearchConnectionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeOutboundCrossClusterSearchConnectionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ElasticsearchService, + input: DescribeOutboundCrossClusterSearchConnectionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeOutboundCrossClusterSearchConnections(input, ...args); +}; +export async function* describeOutboundCrossClusterSearchConnectionsPaginate( + config: ElasticsearchServicePaginationConfiguration, + input: DescribeOutboundCrossClusterSearchConnectionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeOutboundCrossClusterSearchConnectionsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof ElasticsearchService) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ElasticsearchServiceClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ElasticsearchService | ElasticsearchServiceClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-elasticsearch-service/pagination/DescribePackagesPaginator.ts b/clients/client-elasticsearch-service/pagination/DescribePackagesPaginator.ts new file mode 100644 index 0000000000000..562b4dcb95634 --- /dev/null +++ b/clients/client-elasticsearch-service/pagination/DescribePackagesPaginator.ts @@ -0,0 +1,51 @@ +import { ElasticsearchService } from "../ElasticsearchService"; +import { ElasticsearchServiceClient } from "../ElasticsearchServiceClient"; +import { + DescribePackagesCommand, + DescribePackagesCommandInput, + DescribePackagesCommandOutput, +} from "../commands/DescribePackagesCommand"; +import { ElasticsearchServicePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ElasticsearchServiceClient, + input: DescribePackagesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribePackagesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ElasticsearchService, + input: DescribePackagesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describePackages(input, ...args); +}; +export async function* describePackagesPaginate( + config: ElasticsearchServicePaginationConfiguration, + input: DescribePackagesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribePackagesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof ElasticsearchService) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ElasticsearchServiceClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ElasticsearchService | ElasticsearchServiceClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-elasticsearch-service/pagination/DescribeReservedElasticsearchInstanceOfferingsPaginator.ts b/clients/client-elasticsearch-service/pagination/DescribeReservedElasticsearchInstanceOfferingsPaginator.ts new file mode 100644 index 0000000000000..4ca072b35dd20 --- /dev/null +++ b/clients/client-elasticsearch-service/pagination/DescribeReservedElasticsearchInstanceOfferingsPaginator.ts @@ -0,0 +1,51 @@ +import { ElasticsearchService } from "../ElasticsearchService"; +import { ElasticsearchServiceClient } from "../ElasticsearchServiceClient"; +import { + DescribeReservedElasticsearchInstanceOfferingsCommand, + DescribeReservedElasticsearchInstanceOfferingsCommandInput, + DescribeReservedElasticsearchInstanceOfferingsCommandOutput, +} from "../commands/DescribeReservedElasticsearchInstanceOfferingsCommand"; +import { ElasticsearchServicePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ElasticsearchServiceClient, + input: DescribeReservedElasticsearchInstanceOfferingsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeReservedElasticsearchInstanceOfferingsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ElasticsearchService, + input: DescribeReservedElasticsearchInstanceOfferingsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeReservedElasticsearchInstanceOfferings(input, ...args); +}; +export async function* describeReservedElasticsearchInstanceOfferingsPaginate( + config: ElasticsearchServicePaginationConfiguration, + input: DescribeReservedElasticsearchInstanceOfferingsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeReservedElasticsearchInstanceOfferingsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof ElasticsearchService) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ElasticsearchServiceClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ElasticsearchService | ElasticsearchServiceClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-elasticsearch-service/pagination/DescribeReservedElasticsearchInstancesPaginator.ts b/clients/client-elasticsearch-service/pagination/DescribeReservedElasticsearchInstancesPaginator.ts new file mode 100644 index 0000000000000..bcdc0584098c7 --- /dev/null +++ b/clients/client-elasticsearch-service/pagination/DescribeReservedElasticsearchInstancesPaginator.ts @@ -0,0 +1,51 @@ +import { ElasticsearchService } from "../ElasticsearchService"; +import { ElasticsearchServiceClient } from "../ElasticsearchServiceClient"; +import { + DescribeReservedElasticsearchInstancesCommand, + DescribeReservedElasticsearchInstancesCommandInput, + DescribeReservedElasticsearchInstancesCommandOutput, +} from "../commands/DescribeReservedElasticsearchInstancesCommand"; +import { ElasticsearchServicePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ElasticsearchServiceClient, + input: DescribeReservedElasticsearchInstancesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeReservedElasticsearchInstancesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ElasticsearchService, + input: DescribeReservedElasticsearchInstancesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeReservedElasticsearchInstances(input, ...args); +}; +export async function* describeReservedElasticsearchInstancesPaginate( + config: ElasticsearchServicePaginationConfiguration, + input: DescribeReservedElasticsearchInstancesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeReservedElasticsearchInstancesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof ElasticsearchService) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ElasticsearchServiceClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ElasticsearchService | ElasticsearchServiceClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-elasticsearch-service/pagination/GetUpgradeHistoryPaginator.ts b/clients/client-elasticsearch-service/pagination/GetUpgradeHistoryPaginator.ts new file mode 100644 index 0000000000000..b0709cf85bbd3 --- /dev/null +++ b/clients/client-elasticsearch-service/pagination/GetUpgradeHistoryPaginator.ts @@ -0,0 +1,51 @@ +import { ElasticsearchService } from "../ElasticsearchService"; +import { ElasticsearchServiceClient } from "../ElasticsearchServiceClient"; +import { + GetUpgradeHistoryCommand, + GetUpgradeHistoryCommandInput, + GetUpgradeHistoryCommandOutput, +} from "../commands/GetUpgradeHistoryCommand"; +import { ElasticsearchServicePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ElasticsearchServiceClient, + input: GetUpgradeHistoryCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetUpgradeHistoryCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ElasticsearchService, + input: GetUpgradeHistoryCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getUpgradeHistory(input, ...args); +}; +export async function* getUpgradeHistoryPaginate( + config: ElasticsearchServicePaginationConfiguration, + input: GetUpgradeHistoryCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetUpgradeHistoryCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof ElasticsearchService) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ElasticsearchServiceClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ElasticsearchService | ElasticsearchServiceClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-elasticsearch-service/pagination/Interfaces.ts b/clients/client-elasticsearch-service/pagination/Interfaces.ts new file mode 100644 index 0000000000000..cb75ab6014353 --- /dev/null +++ b/clients/client-elasticsearch-service/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { ElasticsearchService } from "../ElasticsearchService"; +import { ElasticsearchServiceClient } from "../ElasticsearchServiceClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface ElasticsearchServicePaginationConfiguration extends PaginationConfiguration { + client: ElasticsearchService | ElasticsearchServiceClient; +} diff --git a/clients/client-elasticsearch-service/pagination/ListDomainsForPackagePaginator.ts b/clients/client-elasticsearch-service/pagination/ListDomainsForPackagePaginator.ts new file mode 100644 index 0000000000000..621bab5cc07ff --- /dev/null +++ b/clients/client-elasticsearch-service/pagination/ListDomainsForPackagePaginator.ts @@ -0,0 +1,51 @@ +import { ElasticsearchService } from "../ElasticsearchService"; +import { ElasticsearchServiceClient } from "../ElasticsearchServiceClient"; +import { + ListDomainsForPackageCommand, + ListDomainsForPackageCommandInput, + ListDomainsForPackageCommandOutput, +} from "../commands/ListDomainsForPackageCommand"; +import { ElasticsearchServicePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ElasticsearchServiceClient, + input: ListDomainsForPackageCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDomainsForPackageCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ElasticsearchService, + input: ListDomainsForPackageCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDomainsForPackage(input, ...args); +}; +export async function* listDomainsForPackagePaginate( + config: ElasticsearchServicePaginationConfiguration, + input: ListDomainsForPackageCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDomainsForPackageCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof ElasticsearchService) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ElasticsearchServiceClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ElasticsearchService | ElasticsearchServiceClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-elasticsearch-service/pagination/ListElasticsearchInstanceTypesPaginator.ts b/clients/client-elasticsearch-service/pagination/ListElasticsearchInstanceTypesPaginator.ts new file mode 100644 index 0000000000000..8b61d4a4bab0c --- /dev/null +++ b/clients/client-elasticsearch-service/pagination/ListElasticsearchInstanceTypesPaginator.ts @@ -0,0 +1,51 @@ +import { ElasticsearchService } from "../ElasticsearchService"; +import { ElasticsearchServiceClient } from "../ElasticsearchServiceClient"; +import { + ListElasticsearchInstanceTypesCommand, + ListElasticsearchInstanceTypesCommandInput, + ListElasticsearchInstanceTypesCommandOutput, +} from "../commands/ListElasticsearchInstanceTypesCommand"; +import { ElasticsearchServicePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ElasticsearchServiceClient, + input: ListElasticsearchInstanceTypesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListElasticsearchInstanceTypesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ElasticsearchService, + input: ListElasticsearchInstanceTypesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listElasticsearchInstanceTypes(input, ...args); +}; +export async function* listElasticsearchInstanceTypesPaginate( + config: ElasticsearchServicePaginationConfiguration, + input: ListElasticsearchInstanceTypesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListElasticsearchInstanceTypesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof ElasticsearchService) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ElasticsearchServiceClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ElasticsearchService | ElasticsearchServiceClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-elasticsearch-service/pagination/ListElasticsearchVersionsPaginator.ts b/clients/client-elasticsearch-service/pagination/ListElasticsearchVersionsPaginator.ts new file mode 100644 index 0000000000000..734ad1633008d --- /dev/null +++ b/clients/client-elasticsearch-service/pagination/ListElasticsearchVersionsPaginator.ts @@ -0,0 +1,51 @@ +import { ElasticsearchService } from "../ElasticsearchService"; +import { ElasticsearchServiceClient } from "../ElasticsearchServiceClient"; +import { + ListElasticsearchVersionsCommand, + ListElasticsearchVersionsCommandInput, + ListElasticsearchVersionsCommandOutput, +} from "../commands/ListElasticsearchVersionsCommand"; +import { ElasticsearchServicePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ElasticsearchServiceClient, + input: ListElasticsearchVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListElasticsearchVersionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ElasticsearchService, + input: ListElasticsearchVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listElasticsearchVersions(input, ...args); +}; +export async function* listElasticsearchVersionsPaginate( + config: ElasticsearchServicePaginationConfiguration, + input: ListElasticsearchVersionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListElasticsearchVersionsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof ElasticsearchService) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ElasticsearchServiceClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ElasticsearchService | ElasticsearchServiceClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-elasticsearch-service/pagination/ListPackagesForDomainPaginator.ts b/clients/client-elasticsearch-service/pagination/ListPackagesForDomainPaginator.ts new file mode 100644 index 0000000000000..eb275b1b76b58 --- /dev/null +++ b/clients/client-elasticsearch-service/pagination/ListPackagesForDomainPaginator.ts @@ -0,0 +1,51 @@ +import { ElasticsearchService } from "../ElasticsearchService"; +import { ElasticsearchServiceClient } from "../ElasticsearchServiceClient"; +import { + ListPackagesForDomainCommand, + ListPackagesForDomainCommandInput, + ListPackagesForDomainCommandOutput, +} from "../commands/ListPackagesForDomainCommand"; +import { ElasticsearchServicePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ElasticsearchServiceClient, + input: ListPackagesForDomainCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListPackagesForDomainCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ElasticsearchService, + input: ListPackagesForDomainCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listPackagesForDomain(input, ...args); +}; +export async function* listPackagesForDomainPaginate( + config: ElasticsearchServicePaginationConfiguration, + input: ListPackagesForDomainCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListPackagesForDomainCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof ElasticsearchService) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ElasticsearchServiceClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ElasticsearchService | ElasticsearchServiceClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-emr/index.ts b/clients/client-emr/index.ts index fb71d9124b45c..347f83fdf5661 100644 --- a/clients/client-emr/index.ts +++ b/clients/client-emr/index.ts @@ -14,12 +14,19 @@ export * from "./commands/DescribeStepCommand"; export * from "./commands/GetBlockPublicAccessConfigurationCommand"; export * from "./commands/GetManagedScalingPolicyCommand"; export * from "./commands/ListBootstrapActionsCommand"; +export * from "./pagination/ListBootstrapActionsPaginator"; export * from "./commands/ListClustersCommand"; +export * from "./pagination/ListClustersPaginator"; export * from "./commands/ListInstanceFleetsCommand"; +export * from "./pagination/ListInstanceFleetsPaginator"; export * from "./commands/ListInstanceGroupsCommand"; +export * from "./pagination/ListInstanceGroupsPaginator"; export * from "./commands/ListInstancesCommand"; +export * from "./pagination/ListInstancesPaginator"; export * from "./commands/ListSecurityConfigurationsCommand"; +export * from "./pagination/ListSecurityConfigurationsPaginator"; export * from "./commands/ListStepsCommand"; +export * from "./pagination/ListStepsPaginator"; export * from "./commands/ModifyClusterCommand"; export * from "./commands/ModifyInstanceFleetCommand"; export * from "./commands/ModifyInstanceGroupsCommand"; @@ -33,4 +40,5 @@ export * from "./commands/RunJobFlowCommand"; export * from "./commands/SetTerminationProtectionCommand"; export * from "./commands/SetVisibleToAllUsersCommand"; export * from "./commands/TerminateJobFlowsCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-emr/pagination/Interfaces.ts b/clients/client-emr/pagination/Interfaces.ts new file mode 100644 index 0000000000000..60476d317d584 --- /dev/null +++ b/clients/client-emr/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { EMR } from "../EMR"; +import { EMRClient } from "../EMRClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface EMRPaginationConfiguration extends PaginationConfiguration { + client: EMR | EMRClient; +} diff --git a/clients/client-emr/pagination/ListBootstrapActionsPaginator.ts b/clients/client-emr/pagination/ListBootstrapActionsPaginator.ts new file mode 100644 index 0000000000000..46317567ec7e0 --- /dev/null +++ b/clients/client-emr/pagination/ListBootstrapActionsPaginator.ts @@ -0,0 +1,50 @@ +import { EMR } from "../EMR"; +import { EMRClient } from "../EMRClient"; +import { + ListBootstrapActionsCommand, + ListBootstrapActionsCommandInput, + ListBootstrapActionsCommandOutput, +} from "../commands/ListBootstrapActionsCommand"; +import { EMRPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: EMRClient, + input: ListBootstrapActionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListBootstrapActionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: EMR, + input: ListBootstrapActionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listBootstrapActions(input, ...args); +}; +export async function* listBootstrapActionsPaginate( + config: EMRPaginationConfiguration, + input: ListBootstrapActionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListBootstrapActionsCommandOutput; + while (hasNext) { + input["Marker"] = token; + if (config.client instanceof EMR) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof EMRClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected EMR | EMRClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-emr/pagination/ListClustersPaginator.ts b/clients/client-emr/pagination/ListClustersPaginator.ts new file mode 100644 index 0000000000000..da032a717a942 --- /dev/null +++ b/clients/client-emr/pagination/ListClustersPaginator.ts @@ -0,0 +1,50 @@ +import { EMR } from "../EMR"; +import { EMRClient } from "../EMRClient"; +import { + ListClustersCommand, + ListClustersCommandInput, + ListClustersCommandOutput, +} from "../commands/ListClustersCommand"; +import { EMRPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: EMRClient, + input: ListClustersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListClustersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: EMR, + input: ListClustersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listClusters(input, ...args); +}; +export async function* listClustersPaginate( + config: EMRPaginationConfiguration, + input: ListClustersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListClustersCommandOutput; + while (hasNext) { + input["Marker"] = token; + if (config.client instanceof EMR) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof EMRClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected EMR | EMRClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-emr/pagination/ListInstanceFleetsPaginator.ts b/clients/client-emr/pagination/ListInstanceFleetsPaginator.ts new file mode 100644 index 0000000000000..5a9341ac70264 --- /dev/null +++ b/clients/client-emr/pagination/ListInstanceFleetsPaginator.ts @@ -0,0 +1,50 @@ +import { EMR } from "../EMR"; +import { EMRClient } from "../EMRClient"; +import { + ListInstanceFleetsCommand, + ListInstanceFleetsCommandInput, + ListInstanceFleetsCommandOutput, +} from "../commands/ListInstanceFleetsCommand"; +import { EMRPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: EMRClient, + input: ListInstanceFleetsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListInstanceFleetsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: EMR, + input: ListInstanceFleetsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listInstanceFleets(input, ...args); +}; +export async function* listInstanceFleetsPaginate( + config: EMRPaginationConfiguration, + input: ListInstanceFleetsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListInstanceFleetsCommandOutput; + while (hasNext) { + input["Marker"] = token; + if (config.client instanceof EMR) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof EMRClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected EMR | EMRClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-emr/pagination/ListInstanceGroupsPaginator.ts b/clients/client-emr/pagination/ListInstanceGroupsPaginator.ts new file mode 100644 index 0000000000000..c54151ddf6965 --- /dev/null +++ b/clients/client-emr/pagination/ListInstanceGroupsPaginator.ts @@ -0,0 +1,50 @@ +import { EMR } from "../EMR"; +import { EMRClient } from "../EMRClient"; +import { + ListInstanceGroupsCommand, + ListInstanceGroupsCommandInput, + ListInstanceGroupsCommandOutput, +} from "../commands/ListInstanceGroupsCommand"; +import { EMRPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: EMRClient, + input: ListInstanceGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListInstanceGroupsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: EMR, + input: ListInstanceGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listInstanceGroups(input, ...args); +}; +export async function* listInstanceGroupsPaginate( + config: EMRPaginationConfiguration, + input: ListInstanceGroupsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListInstanceGroupsCommandOutput; + while (hasNext) { + input["Marker"] = token; + if (config.client instanceof EMR) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof EMRClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected EMR | EMRClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-emr/pagination/ListInstancesPaginator.ts b/clients/client-emr/pagination/ListInstancesPaginator.ts new file mode 100644 index 0000000000000..d3e6d8754d6ff --- /dev/null +++ b/clients/client-emr/pagination/ListInstancesPaginator.ts @@ -0,0 +1,50 @@ +import { EMR } from "../EMR"; +import { EMRClient } from "../EMRClient"; +import { + ListInstancesCommand, + ListInstancesCommandInput, + ListInstancesCommandOutput, +} from "../commands/ListInstancesCommand"; +import { EMRPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: EMRClient, + input: ListInstancesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListInstancesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: EMR, + input: ListInstancesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listInstances(input, ...args); +}; +export async function* listInstancesPaginate( + config: EMRPaginationConfiguration, + input: ListInstancesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListInstancesCommandOutput; + while (hasNext) { + input["Marker"] = token; + if (config.client instanceof EMR) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof EMRClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected EMR | EMRClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-emr/pagination/ListSecurityConfigurationsPaginator.ts b/clients/client-emr/pagination/ListSecurityConfigurationsPaginator.ts new file mode 100644 index 0000000000000..c10711be20aa5 --- /dev/null +++ b/clients/client-emr/pagination/ListSecurityConfigurationsPaginator.ts @@ -0,0 +1,50 @@ +import { EMR } from "../EMR"; +import { EMRClient } from "../EMRClient"; +import { + ListSecurityConfigurationsCommand, + ListSecurityConfigurationsCommandInput, + ListSecurityConfigurationsCommandOutput, +} from "../commands/ListSecurityConfigurationsCommand"; +import { EMRPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: EMRClient, + input: ListSecurityConfigurationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListSecurityConfigurationsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: EMR, + input: ListSecurityConfigurationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listSecurityConfigurations(input, ...args); +}; +export async function* listSecurityConfigurationsPaginate( + config: EMRPaginationConfiguration, + input: ListSecurityConfigurationsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListSecurityConfigurationsCommandOutput; + while (hasNext) { + input["Marker"] = token; + if (config.client instanceof EMR) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof EMRClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected EMR | EMRClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-emr/pagination/ListStepsPaginator.ts b/clients/client-emr/pagination/ListStepsPaginator.ts new file mode 100644 index 0000000000000..5b36e92d58921 --- /dev/null +++ b/clients/client-emr/pagination/ListStepsPaginator.ts @@ -0,0 +1,46 @@ +import { EMR } from "../EMR"; +import { EMRClient } from "../EMRClient"; +import { ListStepsCommand, ListStepsCommandInput, ListStepsCommandOutput } from "../commands/ListStepsCommand"; +import { EMRPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: EMRClient, + input: ListStepsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListStepsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: EMR, + input: ListStepsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listSteps(input, ...args); +}; +export async function* listStepsPaginate( + config: EMRPaginationConfiguration, + input: ListStepsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListStepsCommandOutput; + while (hasNext) { + input["Marker"] = token; + if (config.client instanceof EMR) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof EMRClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected EMR | EMRClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-fms/index.ts b/clients/client-fms/index.ts index acc86039151b8..b406ee4cc00c2 100644 --- a/clients/client-fms/index.ts +++ b/clients/client-fms/index.ts @@ -16,8 +16,11 @@ export * from "./commands/GetProtocolsListCommand"; export * from "./commands/GetViolationDetailsCommand"; export * from "./commands/ListAppsListsCommand"; export * from "./commands/ListComplianceStatusCommand"; +export * from "./pagination/ListComplianceStatusPaginator"; export * from "./commands/ListMemberAccountsCommand"; +export * from "./pagination/ListMemberAccountsPaginator"; export * from "./commands/ListPoliciesCommand"; +export * from "./pagination/ListPoliciesPaginator"; export * from "./commands/ListProtocolsListsCommand"; export * from "./commands/ListTagsForResourceCommand"; export * from "./commands/PutAppsListCommand"; @@ -26,4 +29,5 @@ export * from "./commands/PutPolicyCommand"; export * from "./commands/PutProtocolsListCommand"; export * from "./commands/TagResourceCommand"; export * from "./commands/UntagResourceCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-fms/pagination/Interfaces.ts b/clients/client-fms/pagination/Interfaces.ts new file mode 100644 index 0000000000000..c2d8cc1c54648 --- /dev/null +++ b/clients/client-fms/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { FMS } from "../FMS"; +import { FMSClient } from "../FMSClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface FMSPaginationConfiguration extends PaginationConfiguration { + client: FMS | FMSClient; +} diff --git a/clients/client-fms/pagination/ListComplianceStatusPaginator.ts b/clients/client-fms/pagination/ListComplianceStatusPaginator.ts new file mode 100644 index 0000000000000..4eee98becf16d --- /dev/null +++ b/clients/client-fms/pagination/ListComplianceStatusPaginator.ts @@ -0,0 +1,51 @@ +import { FMS } from "../FMS"; +import { FMSClient } from "../FMSClient"; +import { + ListComplianceStatusCommand, + ListComplianceStatusCommandInput, + ListComplianceStatusCommandOutput, +} from "../commands/ListComplianceStatusCommand"; +import { FMSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: FMSClient, + input: ListComplianceStatusCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListComplianceStatusCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: FMS, + input: ListComplianceStatusCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listComplianceStatus(input, ...args); +}; +export async function* listComplianceStatusPaginate( + config: FMSPaginationConfiguration, + input: ListComplianceStatusCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListComplianceStatusCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof FMS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof FMSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected FMS | FMSClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-fms/pagination/ListMemberAccountsPaginator.ts b/clients/client-fms/pagination/ListMemberAccountsPaginator.ts new file mode 100644 index 0000000000000..963dda7914bcd --- /dev/null +++ b/clients/client-fms/pagination/ListMemberAccountsPaginator.ts @@ -0,0 +1,51 @@ +import { FMS } from "../FMS"; +import { FMSClient } from "../FMSClient"; +import { + ListMemberAccountsCommand, + ListMemberAccountsCommandInput, + ListMemberAccountsCommandOutput, +} from "../commands/ListMemberAccountsCommand"; +import { FMSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: FMSClient, + input: ListMemberAccountsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListMemberAccountsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: FMS, + input: ListMemberAccountsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listMemberAccounts(input, ...args); +}; +export async function* listMemberAccountsPaginate( + config: FMSPaginationConfiguration, + input: ListMemberAccountsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListMemberAccountsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof FMS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof FMSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected FMS | FMSClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-fms/pagination/ListPoliciesPaginator.ts b/clients/client-fms/pagination/ListPoliciesPaginator.ts new file mode 100644 index 0000000000000..1e18c1a97a410 --- /dev/null +++ b/clients/client-fms/pagination/ListPoliciesPaginator.ts @@ -0,0 +1,51 @@ +import { FMS } from "../FMS"; +import { FMSClient } from "../FMSClient"; +import { + ListPoliciesCommand, + ListPoliciesCommandInput, + ListPoliciesCommandOutput, +} from "../commands/ListPoliciesCommand"; +import { FMSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: FMSClient, + input: ListPoliciesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListPoliciesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: FMS, + input: ListPoliciesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listPolicies(input, ...args); +}; +export async function* listPoliciesPaginate( + config: FMSPaginationConfiguration, + input: ListPoliciesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListPoliciesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof FMS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof FMSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected FMS | FMSClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-forecast/index.ts b/clients/client-forecast/index.ts index d99d3c50a572a..22c63fbada880 100644 --- a/clients/client-forecast/index.ts +++ b/clients/client-forecast/index.ts @@ -20,13 +20,20 @@ export * from "./commands/DescribeForecastExportJobCommand"; export * from "./commands/DescribePredictorCommand"; export * from "./commands/GetAccuracyMetricsCommand"; export * from "./commands/ListDatasetGroupsCommand"; +export * from "./pagination/ListDatasetGroupsPaginator"; export * from "./commands/ListDatasetImportJobsCommand"; +export * from "./pagination/ListDatasetImportJobsPaginator"; export * from "./commands/ListDatasetsCommand"; +export * from "./pagination/ListDatasetsPaginator"; export * from "./commands/ListForecastExportJobsCommand"; +export * from "./pagination/ListForecastExportJobsPaginator"; export * from "./commands/ListForecastsCommand"; +export * from "./pagination/ListForecastsPaginator"; export * from "./commands/ListPredictorsCommand"; +export * from "./pagination/ListPredictorsPaginator"; export * from "./commands/ListTagsForResourceCommand"; export * from "./commands/TagResourceCommand"; export * from "./commands/UntagResourceCommand"; export * from "./commands/UpdateDatasetGroupCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-forecast/pagination/Interfaces.ts b/clients/client-forecast/pagination/Interfaces.ts new file mode 100644 index 0000000000000..4c4b9630bf012 --- /dev/null +++ b/clients/client-forecast/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { Forecast } from "../Forecast"; +import { ForecastClient } from "../ForecastClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface ForecastPaginationConfiguration extends PaginationConfiguration { + client: Forecast | ForecastClient; +} diff --git a/clients/client-forecast/pagination/ListDatasetGroupsPaginator.ts b/clients/client-forecast/pagination/ListDatasetGroupsPaginator.ts new file mode 100644 index 0000000000000..ef7612c74f45b --- /dev/null +++ b/clients/client-forecast/pagination/ListDatasetGroupsPaginator.ts @@ -0,0 +1,51 @@ +import { Forecast } from "../Forecast"; +import { ForecastClient } from "../ForecastClient"; +import { + ListDatasetGroupsCommand, + ListDatasetGroupsCommandInput, + ListDatasetGroupsCommandOutput, +} from "../commands/ListDatasetGroupsCommand"; +import { ForecastPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ForecastClient, + input: ListDatasetGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDatasetGroupsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Forecast, + input: ListDatasetGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDatasetGroups(input, ...args); +}; +export async function* listDatasetGroupsPaginate( + config: ForecastPaginationConfiguration, + input: ListDatasetGroupsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDatasetGroupsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Forecast) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ForecastClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Forecast | ForecastClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-forecast/pagination/ListDatasetImportJobsPaginator.ts b/clients/client-forecast/pagination/ListDatasetImportJobsPaginator.ts new file mode 100644 index 0000000000000..7e4f62af7e227 --- /dev/null +++ b/clients/client-forecast/pagination/ListDatasetImportJobsPaginator.ts @@ -0,0 +1,51 @@ +import { Forecast } from "../Forecast"; +import { ForecastClient } from "../ForecastClient"; +import { + ListDatasetImportJobsCommand, + ListDatasetImportJobsCommandInput, + ListDatasetImportJobsCommandOutput, +} from "../commands/ListDatasetImportJobsCommand"; +import { ForecastPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ForecastClient, + input: ListDatasetImportJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDatasetImportJobsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Forecast, + input: ListDatasetImportJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDatasetImportJobs(input, ...args); +}; +export async function* listDatasetImportJobsPaginate( + config: ForecastPaginationConfiguration, + input: ListDatasetImportJobsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDatasetImportJobsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Forecast) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ForecastClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Forecast | ForecastClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-forecast/pagination/ListDatasetsPaginator.ts b/clients/client-forecast/pagination/ListDatasetsPaginator.ts new file mode 100644 index 0000000000000..2eedf87066919 --- /dev/null +++ b/clients/client-forecast/pagination/ListDatasetsPaginator.ts @@ -0,0 +1,51 @@ +import { Forecast } from "../Forecast"; +import { ForecastClient } from "../ForecastClient"; +import { + ListDatasetsCommand, + ListDatasetsCommandInput, + ListDatasetsCommandOutput, +} from "../commands/ListDatasetsCommand"; +import { ForecastPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ForecastClient, + input: ListDatasetsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDatasetsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Forecast, + input: ListDatasetsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDatasets(input, ...args); +}; +export async function* listDatasetsPaginate( + config: ForecastPaginationConfiguration, + input: ListDatasetsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDatasetsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Forecast) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ForecastClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Forecast | ForecastClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-forecast/pagination/ListForecastExportJobsPaginator.ts b/clients/client-forecast/pagination/ListForecastExportJobsPaginator.ts new file mode 100644 index 0000000000000..dd1cc20ad7e8f --- /dev/null +++ b/clients/client-forecast/pagination/ListForecastExportJobsPaginator.ts @@ -0,0 +1,51 @@ +import { Forecast } from "../Forecast"; +import { ForecastClient } from "../ForecastClient"; +import { + ListForecastExportJobsCommand, + ListForecastExportJobsCommandInput, + ListForecastExportJobsCommandOutput, +} from "../commands/ListForecastExportJobsCommand"; +import { ForecastPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ForecastClient, + input: ListForecastExportJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListForecastExportJobsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Forecast, + input: ListForecastExportJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listForecastExportJobs(input, ...args); +}; +export async function* listForecastExportJobsPaginate( + config: ForecastPaginationConfiguration, + input: ListForecastExportJobsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListForecastExportJobsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Forecast) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ForecastClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Forecast | ForecastClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-forecast/pagination/ListForecastsPaginator.ts b/clients/client-forecast/pagination/ListForecastsPaginator.ts new file mode 100644 index 0000000000000..96448fcb432b5 --- /dev/null +++ b/clients/client-forecast/pagination/ListForecastsPaginator.ts @@ -0,0 +1,51 @@ +import { Forecast } from "../Forecast"; +import { ForecastClient } from "../ForecastClient"; +import { + ListForecastsCommand, + ListForecastsCommandInput, + ListForecastsCommandOutput, +} from "../commands/ListForecastsCommand"; +import { ForecastPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ForecastClient, + input: ListForecastsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListForecastsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Forecast, + input: ListForecastsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listForecasts(input, ...args); +}; +export async function* listForecastsPaginate( + config: ForecastPaginationConfiguration, + input: ListForecastsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListForecastsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Forecast) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ForecastClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Forecast | ForecastClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-forecast/pagination/ListPredictorsPaginator.ts b/clients/client-forecast/pagination/ListPredictorsPaginator.ts new file mode 100644 index 0000000000000..eae0d544900d4 --- /dev/null +++ b/clients/client-forecast/pagination/ListPredictorsPaginator.ts @@ -0,0 +1,51 @@ +import { Forecast } from "../Forecast"; +import { ForecastClient } from "../ForecastClient"; +import { + ListPredictorsCommand, + ListPredictorsCommandInput, + ListPredictorsCommandOutput, +} from "../commands/ListPredictorsCommand"; +import { ForecastPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ForecastClient, + input: ListPredictorsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListPredictorsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Forecast, + input: ListPredictorsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listPredictors(input, ...args); +}; +export async function* listPredictorsPaginate( + config: ForecastPaginationConfiguration, + input: ListPredictorsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListPredictorsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Forecast) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ForecastClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Forecast | ForecastClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-frauddetector/index.ts b/clients/client-frauddetector/index.ts index f7205da5d02ce..c928c6066201c 100644 --- a/clients/client-frauddetector/index.ts +++ b/clients/client-frauddetector/index.ts @@ -13,20 +13,31 @@ export * from "./commands/DeleteEventCommand"; export * from "./commands/DeleteRuleCommand"; export * from "./commands/DescribeDetectorCommand"; export * from "./commands/DescribeModelVersionsCommand"; +export * from "./pagination/DescribeModelVersionsPaginator"; export * from "./commands/GetDetectorsCommand"; +export * from "./pagination/GetDetectorsPaginator"; export * from "./commands/GetDetectorVersionCommand"; export * from "./commands/GetEntityTypesCommand"; +export * from "./pagination/GetEntityTypesPaginator"; export * from "./commands/GetEventPredictionCommand"; export * from "./commands/GetEventTypesCommand"; +export * from "./pagination/GetEventTypesPaginator"; export * from "./commands/GetExternalModelsCommand"; +export * from "./pagination/GetExternalModelsPaginator"; export * from "./commands/GetKMSEncryptionKeyCommand"; export * from "./commands/GetLabelsCommand"; +export * from "./pagination/GetLabelsPaginator"; export * from "./commands/GetModelsCommand"; +export * from "./pagination/GetModelsPaginator"; export * from "./commands/GetModelVersionCommand"; export * from "./commands/GetOutcomesCommand"; +export * from "./pagination/GetOutcomesPaginator"; export * from "./commands/GetRulesCommand"; +export * from "./pagination/GetRulesPaginator"; export * from "./commands/GetVariablesCommand"; +export * from "./pagination/GetVariablesPaginator"; export * from "./commands/ListTagsForResourceCommand"; +export * from "./pagination/ListTagsForResourcePaginator"; export * from "./commands/PutDetectorCommand"; export * from "./commands/PutEntityTypeCommand"; export * from "./commands/PutEventTypeCommand"; @@ -45,4 +56,5 @@ export * from "./commands/UpdateModelVersionStatusCommand"; export * from "./commands/UpdateRuleMetadataCommand"; export * from "./commands/UpdateRuleVersionCommand"; export * from "./commands/UpdateVariableCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-frauddetector/pagination/DescribeModelVersionsPaginator.ts b/clients/client-frauddetector/pagination/DescribeModelVersionsPaginator.ts new file mode 100644 index 0000000000000..4c427d86fc7ab --- /dev/null +++ b/clients/client-frauddetector/pagination/DescribeModelVersionsPaginator.ts @@ -0,0 +1,51 @@ +import { FraudDetector } from "../FraudDetector"; +import { FraudDetectorClient } from "../FraudDetectorClient"; +import { + DescribeModelVersionsCommand, + DescribeModelVersionsCommandInput, + DescribeModelVersionsCommandOutput, +} from "../commands/DescribeModelVersionsCommand"; +import { FraudDetectorPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: FraudDetectorClient, + input: DescribeModelVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeModelVersionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: FraudDetector, + input: DescribeModelVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeModelVersions(input, ...args); +}; +export async function* describeModelVersionsPaginate( + config: FraudDetectorPaginationConfiguration, + input: DescribeModelVersionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeModelVersionsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof FraudDetector) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof FraudDetectorClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected FraudDetector | FraudDetectorClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-frauddetector/pagination/GetDetectorsPaginator.ts b/clients/client-frauddetector/pagination/GetDetectorsPaginator.ts new file mode 100644 index 0000000000000..9d5024753aa69 --- /dev/null +++ b/clients/client-frauddetector/pagination/GetDetectorsPaginator.ts @@ -0,0 +1,51 @@ +import { FraudDetector } from "../FraudDetector"; +import { FraudDetectorClient } from "../FraudDetectorClient"; +import { + GetDetectorsCommand, + GetDetectorsCommandInput, + GetDetectorsCommandOutput, +} from "../commands/GetDetectorsCommand"; +import { FraudDetectorPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: FraudDetectorClient, + input: GetDetectorsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetDetectorsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: FraudDetector, + input: GetDetectorsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getDetectors(input, ...args); +}; +export async function* getDetectorsPaginate( + config: FraudDetectorPaginationConfiguration, + input: GetDetectorsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetDetectorsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof FraudDetector) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof FraudDetectorClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected FraudDetector | FraudDetectorClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-frauddetector/pagination/GetEntityTypesPaginator.ts b/clients/client-frauddetector/pagination/GetEntityTypesPaginator.ts new file mode 100644 index 0000000000000..1c41c38942404 --- /dev/null +++ b/clients/client-frauddetector/pagination/GetEntityTypesPaginator.ts @@ -0,0 +1,51 @@ +import { FraudDetector } from "../FraudDetector"; +import { FraudDetectorClient } from "../FraudDetectorClient"; +import { + GetEntityTypesCommand, + GetEntityTypesCommandInput, + GetEntityTypesCommandOutput, +} from "../commands/GetEntityTypesCommand"; +import { FraudDetectorPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: FraudDetectorClient, + input: GetEntityTypesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetEntityTypesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: FraudDetector, + input: GetEntityTypesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getEntityTypes(input, ...args); +}; +export async function* getEntityTypesPaginate( + config: FraudDetectorPaginationConfiguration, + input: GetEntityTypesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetEntityTypesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof FraudDetector) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof FraudDetectorClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected FraudDetector | FraudDetectorClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-frauddetector/pagination/GetEventTypesPaginator.ts b/clients/client-frauddetector/pagination/GetEventTypesPaginator.ts new file mode 100644 index 0000000000000..0009bdc816b12 --- /dev/null +++ b/clients/client-frauddetector/pagination/GetEventTypesPaginator.ts @@ -0,0 +1,51 @@ +import { FraudDetector } from "../FraudDetector"; +import { FraudDetectorClient } from "../FraudDetectorClient"; +import { + GetEventTypesCommand, + GetEventTypesCommandInput, + GetEventTypesCommandOutput, +} from "../commands/GetEventTypesCommand"; +import { FraudDetectorPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: FraudDetectorClient, + input: GetEventTypesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetEventTypesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: FraudDetector, + input: GetEventTypesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getEventTypes(input, ...args); +}; +export async function* getEventTypesPaginate( + config: FraudDetectorPaginationConfiguration, + input: GetEventTypesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetEventTypesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof FraudDetector) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof FraudDetectorClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected FraudDetector | FraudDetectorClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-frauddetector/pagination/GetExternalModelsPaginator.ts b/clients/client-frauddetector/pagination/GetExternalModelsPaginator.ts new file mode 100644 index 0000000000000..4f7443eab8c26 --- /dev/null +++ b/clients/client-frauddetector/pagination/GetExternalModelsPaginator.ts @@ -0,0 +1,51 @@ +import { FraudDetector } from "../FraudDetector"; +import { FraudDetectorClient } from "../FraudDetectorClient"; +import { + GetExternalModelsCommand, + GetExternalModelsCommandInput, + GetExternalModelsCommandOutput, +} from "../commands/GetExternalModelsCommand"; +import { FraudDetectorPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: FraudDetectorClient, + input: GetExternalModelsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetExternalModelsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: FraudDetector, + input: GetExternalModelsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getExternalModels(input, ...args); +}; +export async function* getExternalModelsPaginate( + config: FraudDetectorPaginationConfiguration, + input: GetExternalModelsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetExternalModelsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof FraudDetector) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof FraudDetectorClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected FraudDetector | FraudDetectorClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-frauddetector/pagination/GetLabelsPaginator.ts b/clients/client-frauddetector/pagination/GetLabelsPaginator.ts new file mode 100644 index 0000000000000..533ea72269af8 --- /dev/null +++ b/clients/client-frauddetector/pagination/GetLabelsPaginator.ts @@ -0,0 +1,47 @@ +import { FraudDetector } from "../FraudDetector"; +import { FraudDetectorClient } from "../FraudDetectorClient"; +import { GetLabelsCommand, GetLabelsCommandInput, GetLabelsCommandOutput } from "../commands/GetLabelsCommand"; +import { FraudDetectorPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: FraudDetectorClient, + input: GetLabelsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetLabelsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: FraudDetector, + input: GetLabelsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getLabels(input, ...args); +}; +export async function* getLabelsPaginate( + config: FraudDetectorPaginationConfiguration, + input: GetLabelsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetLabelsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof FraudDetector) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof FraudDetectorClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected FraudDetector | FraudDetectorClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-frauddetector/pagination/GetModelsPaginator.ts b/clients/client-frauddetector/pagination/GetModelsPaginator.ts new file mode 100644 index 0000000000000..b245295d476ba --- /dev/null +++ b/clients/client-frauddetector/pagination/GetModelsPaginator.ts @@ -0,0 +1,47 @@ +import { FraudDetector } from "../FraudDetector"; +import { FraudDetectorClient } from "../FraudDetectorClient"; +import { GetModelsCommand, GetModelsCommandInput, GetModelsCommandOutput } from "../commands/GetModelsCommand"; +import { FraudDetectorPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: FraudDetectorClient, + input: GetModelsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetModelsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: FraudDetector, + input: GetModelsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getModels(input, ...args); +}; +export async function* getModelsPaginate( + config: FraudDetectorPaginationConfiguration, + input: GetModelsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetModelsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof FraudDetector) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof FraudDetectorClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected FraudDetector | FraudDetectorClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-frauddetector/pagination/GetOutcomesPaginator.ts b/clients/client-frauddetector/pagination/GetOutcomesPaginator.ts new file mode 100644 index 0000000000000..7b3d5e1855d43 --- /dev/null +++ b/clients/client-frauddetector/pagination/GetOutcomesPaginator.ts @@ -0,0 +1,47 @@ +import { FraudDetector } from "../FraudDetector"; +import { FraudDetectorClient } from "../FraudDetectorClient"; +import { GetOutcomesCommand, GetOutcomesCommandInput, GetOutcomesCommandOutput } from "../commands/GetOutcomesCommand"; +import { FraudDetectorPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: FraudDetectorClient, + input: GetOutcomesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetOutcomesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: FraudDetector, + input: GetOutcomesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getOutcomes(input, ...args); +}; +export async function* getOutcomesPaginate( + config: FraudDetectorPaginationConfiguration, + input: GetOutcomesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetOutcomesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof FraudDetector) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof FraudDetectorClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected FraudDetector | FraudDetectorClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-frauddetector/pagination/GetRulesPaginator.ts b/clients/client-frauddetector/pagination/GetRulesPaginator.ts new file mode 100644 index 0000000000000..d3c373a2bcb72 --- /dev/null +++ b/clients/client-frauddetector/pagination/GetRulesPaginator.ts @@ -0,0 +1,47 @@ +import { FraudDetector } from "../FraudDetector"; +import { FraudDetectorClient } from "../FraudDetectorClient"; +import { GetRulesCommand, GetRulesCommandInput, GetRulesCommandOutput } from "../commands/GetRulesCommand"; +import { FraudDetectorPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: FraudDetectorClient, + input: GetRulesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetRulesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: FraudDetector, + input: GetRulesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getRules(input, ...args); +}; +export async function* getRulesPaginate( + config: FraudDetectorPaginationConfiguration, + input: GetRulesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetRulesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof FraudDetector) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof FraudDetectorClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected FraudDetector | FraudDetectorClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-frauddetector/pagination/GetVariablesPaginator.ts b/clients/client-frauddetector/pagination/GetVariablesPaginator.ts new file mode 100644 index 0000000000000..9e7c42a2190d2 --- /dev/null +++ b/clients/client-frauddetector/pagination/GetVariablesPaginator.ts @@ -0,0 +1,51 @@ +import { FraudDetector } from "../FraudDetector"; +import { FraudDetectorClient } from "../FraudDetectorClient"; +import { + GetVariablesCommand, + GetVariablesCommandInput, + GetVariablesCommandOutput, +} from "../commands/GetVariablesCommand"; +import { FraudDetectorPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: FraudDetectorClient, + input: GetVariablesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetVariablesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: FraudDetector, + input: GetVariablesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getVariables(input, ...args); +}; +export async function* getVariablesPaginate( + config: FraudDetectorPaginationConfiguration, + input: GetVariablesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetVariablesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof FraudDetector) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof FraudDetectorClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected FraudDetector | FraudDetectorClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-frauddetector/pagination/Interfaces.ts b/clients/client-frauddetector/pagination/Interfaces.ts new file mode 100644 index 0000000000000..871b98b920cad --- /dev/null +++ b/clients/client-frauddetector/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { FraudDetector } from "../FraudDetector"; +import { FraudDetectorClient } from "../FraudDetectorClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface FraudDetectorPaginationConfiguration extends PaginationConfiguration { + client: FraudDetector | FraudDetectorClient; +} diff --git a/clients/client-frauddetector/pagination/ListTagsForResourcePaginator.ts b/clients/client-frauddetector/pagination/ListTagsForResourcePaginator.ts new file mode 100644 index 0000000000000..f06d83b9c1eb0 --- /dev/null +++ b/clients/client-frauddetector/pagination/ListTagsForResourcePaginator.ts @@ -0,0 +1,51 @@ +import { FraudDetector } from "../FraudDetector"; +import { FraudDetectorClient } from "../FraudDetectorClient"; +import { + ListTagsForResourceCommand, + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput, +} from "../commands/ListTagsForResourceCommand"; +import { FraudDetectorPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: FraudDetectorClient, + input: ListTagsForResourceCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTagsForResourceCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: FraudDetector, + input: ListTagsForResourceCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTagsForResource(input, ...args); +}; +export async function* listTagsForResourcePaginate( + config: FraudDetectorPaginationConfiguration, + input: ListTagsForResourceCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTagsForResourceCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof FraudDetector) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof FraudDetectorClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected FraudDetector | FraudDetectorClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-fsx/index.ts b/clients/client-fsx/index.ts index 161b4220f654f..ba6ae6e173011 100644 --- a/clients/client-fsx/index.ts +++ b/clients/client-fsx/index.ts @@ -8,10 +8,14 @@ export * from "./commands/CreateFileSystemFromBackupCommand"; export * from "./commands/DeleteBackupCommand"; export * from "./commands/DeleteFileSystemCommand"; export * from "./commands/DescribeBackupsCommand"; +export * from "./pagination/DescribeBackupsPaginator"; export * from "./commands/DescribeDataRepositoryTasksCommand"; +export * from "./pagination/DescribeDataRepositoryTasksPaginator"; export * from "./commands/DescribeFileSystemsCommand"; +export * from "./pagination/DescribeFileSystemsPaginator"; export * from "./commands/ListTagsForResourceCommand"; export * from "./commands/TagResourceCommand"; export * from "./commands/UntagResourceCommand"; export * from "./commands/UpdateFileSystemCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-fsx/pagination/DescribeBackupsPaginator.ts b/clients/client-fsx/pagination/DescribeBackupsPaginator.ts new file mode 100644 index 0000000000000..00f403c601325 --- /dev/null +++ b/clients/client-fsx/pagination/DescribeBackupsPaginator.ts @@ -0,0 +1,51 @@ +import { FSx } from "../FSx"; +import { FSxClient } from "../FSxClient"; +import { + DescribeBackupsCommand, + DescribeBackupsCommandInput, + DescribeBackupsCommandOutput, +} from "../commands/DescribeBackupsCommand"; +import { FSxPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: FSxClient, + input: DescribeBackupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeBackupsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: FSx, + input: DescribeBackupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeBackups(input, ...args); +}; +export async function* describeBackupsPaginate( + config: FSxPaginationConfiguration, + input: DescribeBackupsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeBackupsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof FSx) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof FSxClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected FSx | FSxClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-fsx/pagination/DescribeDataRepositoryTasksPaginator.ts b/clients/client-fsx/pagination/DescribeDataRepositoryTasksPaginator.ts new file mode 100644 index 0000000000000..350e680add7e6 --- /dev/null +++ b/clients/client-fsx/pagination/DescribeDataRepositoryTasksPaginator.ts @@ -0,0 +1,51 @@ +import { FSx } from "../FSx"; +import { FSxClient } from "../FSxClient"; +import { + DescribeDataRepositoryTasksCommand, + DescribeDataRepositoryTasksCommandInput, + DescribeDataRepositoryTasksCommandOutput, +} from "../commands/DescribeDataRepositoryTasksCommand"; +import { FSxPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: FSxClient, + input: DescribeDataRepositoryTasksCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeDataRepositoryTasksCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: FSx, + input: DescribeDataRepositoryTasksCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeDataRepositoryTasks(input, ...args); +}; +export async function* describeDataRepositoryTasksPaginate( + config: FSxPaginationConfiguration, + input: DescribeDataRepositoryTasksCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeDataRepositoryTasksCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof FSx) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof FSxClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected FSx | FSxClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-fsx/pagination/DescribeFileSystemsPaginator.ts b/clients/client-fsx/pagination/DescribeFileSystemsPaginator.ts new file mode 100644 index 0000000000000..d355c5629a2b2 --- /dev/null +++ b/clients/client-fsx/pagination/DescribeFileSystemsPaginator.ts @@ -0,0 +1,51 @@ +import { FSx } from "../FSx"; +import { FSxClient } from "../FSxClient"; +import { + DescribeFileSystemsCommand, + DescribeFileSystemsCommandInput, + DescribeFileSystemsCommandOutput, +} from "../commands/DescribeFileSystemsCommand"; +import { FSxPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: FSxClient, + input: DescribeFileSystemsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeFileSystemsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: FSx, + input: DescribeFileSystemsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeFileSystems(input, ...args); +}; +export async function* describeFileSystemsPaginate( + config: FSxPaginationConfiguration, + input: DescribeFileSystemsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeFileSystemsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof FSx) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof FSxClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected FSx | FSxClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-fsx/pagination/Interfaces.ts b/clients/client-fsx/pagination/Interfaces.ts new file mode 100644 index 0000000000000..dad6e64b85ed3 --- /dev/null +++ b/clients/client-fsx/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { FSx } from "../FSx"; +import { FSxClient } from "../FSxClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface FSxPaginationConfiguration extends PaginationConfiguration { + client: FSx | FSxClient; +} diff --git a/clients/client-glue/index.ts b/clients/client-glue/index.ts index e8d847a9ce8f4..6219d90330b9e 100644 --- a/clients/client-glue/index.ts +++ b/clients/client-glue/index.ts @@ -47,31 +47,42 @@ export * from "./commands/DeleteWorkflowCommand"; export * from "./commands/GetCatalogImportStatusCommand"; export * from "./commands/GetClassifierCommand"; export * from "./commands/GetClassifiersCommand"; +export * from "./pagination/GetClassifiersPaginator"; export * from "./commands/GetColumnStatisticsForPartitionCommand"; export * from "./commands/GetColumnStatisticsForTableCommand"; export * from "./commands/GetConnectionCommand"; export * from "./commands/GetConnectionsCommand"; +export * from "./pagination/GetConnectionsPaginator"; export * from "./commands/GetCrawlerCommand"; export * from "./commands/GetCrawlerMetricsCommand"; +export * from "./pagination/GetCrawlerMetricsPaginator"; export * from "./commands/GetCrawlersCommand"; +export * from "./pagination/GetCrawlersPaginator"; export * from "./commands/GetDatabaseCommand"; export * from "./commands/GetDatabasesCommand"; +export * from "./pagination/GetDatabasesPaginator"; export * from "./commands/GetDataCatalogEncryptionSettingsCommand"; export * from "./commands/GetDataflowGraphCommand"; export * from "./commands/GetDevEndpointCommand"; export * from "./commands/GetDevEndpointsCommand"; +export * from "./pagination/GetDevEndpointsPaginator"; export * from "./commands/GetJobCommand"; export * from "./commands/GetJobBookmarkCommand"; export * from "./commands/GetJobRunCommand"; export * from "./commands/GetJobRunsCommand"; +export * from "./pagination/GetJobRunsPaginator"; export * from "./commands/GetJobsCommand"; +export * from "./pagination/GetJobsPaginator"; export * from "./commands/GetMappingCommand"; export * from "./commands/GetMLTaskRunCommand"; export * from "./commands/GetMLTaskRunsCommand"; +export * from "./pagination/GetMLTaskRunsPaginator"; export * from "./commands/GetMLTransformCommand"; export * from "./commands/GetMLTransformsCommand"; +export * from "./pagination/GetMLTransformsPaginator"; export * from "./commands/GetPartitionCommand"; export * from "./commands/GetPartitionsCommand"; +export * from "./pagination/GetPartitionsPaginator"; export * from "./commands/GetPlanCommand"; export * from "./commands/GetResourcePoliciesCommand"; export * from "./commands/GetResourcePolicyCommand"; @@ -79,30 +90,42 @@ export * from "./commands/GetSecurityConfigurationCommand"; export * from "./commands/GetSecurityConfigurationsCommand"; export * from "./commands/GetTableCommand"; export * from "./commands/GetTablesCommand"; +export * from "./pagination/GetTablesPaginator"; export * from "./commands/GetTableVersionCommand"; export * from "./commands/GetTableVersionsCommand"; +export * from "./pagination/GetTableVersionsPaginator"; export * from "./commands/GetTagsCommand"; export * from "./commands/GetTriggerCommand"; export * from "./commands/GetTriggersCommand"; +export * from "./pagination/GetTriggersPaginator"; export * from "./commands/GetUserDefinedFunctionCommand"; export * from "./commands/GetUserDefinedFunctionsCommand"; +export * from "./pagination/GetUserDefinedFunctionsPaginator"; export * from "./commands/GetWorkflowCommand"; export * from "./commands/GetWorkflowRunCommand"; export * from "./commands/GetWorkflowRunPropertiesCommand"; export * from "./commands/GetWorkflowRunsCommand"; +export * from "./pagination/GetWorkflowRunsPaginator"; export * from "./commands/ImportCatalogToGlueCommand"; export * from "./commands/ListCrawlersCommand"; +export * from "./pagination/ListCrawlersPaginator"; export * from "./commands/ListDevEndpointsCommand"; +export * from "./pagination/ListDevEndpointsPaginator"; export * from "./commands/ListJobsCommand"; +export * from "./pagination/ListJobsPaginator"; export * from "./commands/ListMLTransformsCommand"; +export * from "./pagination/ListMLTransformsPaginator"; export * from "./commands/ListTriggersCommand"; +export * from "./pagination/ListTriggersPaginator"; export * from "./commands/ListWorkflowsCommand"; +export * from "./pagination/ListWorkflowsPaginator"; export * from "./commands/PutDataCatalogEncryptionSettingsCommand"; export * from "./commands/PutResourcePolicyCommand"; export * from "./commands/PutWorkflowRunPropertiesCommand"; export * from "./commands/ResetJobBookmarkCommand"; export * from "./commands/ResumeWorkflowRunCommand"; export * from "./commands/SearchTablesCommand"; +export * from "./pagination/SearchTablesPaginator"; export * from "./commands/StartCrawlerCommand"; export * from "./commands/StartCrawlerScheduleCommand"; export * from "./commands/StartExportLabelsTaskRunCommand"; @@ -133,4 +156,5 @@ export * from "./commands/UpdateTableCommand"; export * from "./commands/UpdateTriggerCommand"; export * from "./commands/UpdateUserDefinedFunctionCommand"; export * from "./commands/UpdateWorkflowCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-glue/pagination/GetClassifiersPaginator.ts b/clients/client-glue/pagination/GetClassifiersPaginator.ts new file mode 100644 index 0000000000000..b6524f4e70280 --- /dev/null +++ b/clients/client-glue/pagination/GetClassifiersPaginator.ts @@ -0,0 +1,51 @@ +import { Glue } from "../Glue"; +import { GlueClient } from "../GlueClient"; +import { + GetClassifiersCommand, + GetClassifiersCommandInput, + GetClassifiersCommandOutput, +} from "../commands/GetClassifiersCommand"; +import { GluePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: GlueClient, + input: GetClassifiersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetClassifiersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Glue, + input: GetClassifiersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getClassifiers(input, ...args); +}; +export async function* getClassifiersPaginate( + config: GluePaginationConfiguration, + input: GetClassifiersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetClassifiersCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Glue) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof GlueClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Glue | GlueClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-glue/pagination/GetConnectionsPaginator.ts b/clients/client-glue/pagination/GetConnectionsPaginator.ts new file mode 100644 index 0000000000000..2d4b23f6de87b --- /dev/null +++ b/clients/client-glue/pagination/GetConnectionsPaginator.ts @@ -0,0 +1,51 @@ +import { Glue } from "../Glue"; +import { GlueClient } from "../GlueClient"; +import { + GetConnectionsCommand, + GetConnectionsCommandInput, + GetConnectionsCommandOutput, +} from "../commands/GetConnectionsCommand"; +import { GluePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: GlueClient, + input: GetConnectionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetConnectionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Glue, + input: GetConnectionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getConnections(input, ...args); +}; +export async function* getConnectionsPaginate( + config: GluePaginationConfiguration, + input: GetConnectionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetConnectionsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Glue) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof GlueClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Glue | GlueClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-glue/pagination/GetCrawlerMetricsPaginator.ts b/clients/client-glue/pagination/GetCrawlerMetricsPaginator.ts new file mode 100644 index 0000000000000..16f3d2a548c9f --- /dev/null +++ b/clients/client-glue/pagination/GetCrawlerMetricsPaginator.ts @@ -0,0 +1,51 @@ +import { Glue } from "../Glue"; +import { GlueClient } from "../GlueClient"; +import { + GetCrawlerMetricsCommand, + GetCrawlerMetricsCommandInput, + GetCrawlerMetricsCommandOutput, +} from "../commands/GetCrawlerMetricsCommand"; +import { GluePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: GlueClient, + input: GetCrawlerMetricsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetCrawlerMetricsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Glue, + input: GetCrawlerMetricsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getCrawlerMetrics(input, ...args); +}; +export async function* getCrawlerMetricsPaginate( + config: GluePaginationConfiguration, + input: GetCrawlerMetricsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetCrawlerMetricsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Glue) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof GlueClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Glue | GlueClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-glue/pagination/GetCrawlersPaginator.ts b/clients/client-glue/pagination/GetCrawlersPaginator.ts new file mode 100644 index 0000000000000..5f64eedc951e7 --- /dev/null +++ b/clients/client-glue/pagination/GetCrawlersPaginator.ts @@ -0,0 +1,47 @@ +import { Glue } from "../Glue"; +import { GlueClient } from "../GlueClient"; +import { GetCrawlersCommand, GetCrawlersCommandInput, GetCrawlersCommandOutput } from "../commands/GetCrawlersCommand"; +import { GluePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: GlueClient, + input: GetCrawlersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetCrawlersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Glue, + input: GetCrawlersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getCrawlers(input, ...args); +}; +export async function* getCrawlersPaginate( + config: GluePaginationConfiguration, + input: GetCrawlersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetCrawlersCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Glue) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof GlueClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Glue | GlueClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-glue/pagination/GetDatabasesPaginator.ts b/clients/client-glue/pagination/GetDatabasesPaginator.ts new file mode 100644 index 0000000000000..20921261562b8 --- /dev/null +++ b/clients/client-glue/pagination/GetDatabasesPaginator.ts @@ -0,0 +1,51 @@ +import { Glue } from "../Glue"; +import { GlueClient } from "../GlueClient"; +import { + GetDatabasesCommand, + GetDatabasesCommandInput, + GetDatabasesCommandOutput, +} from "../commands/GetDatabasesCommand"; +import { GluePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: GlueClient, + input: GetDatabasesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetDatabasesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Glue, + input: GetDatabasesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getDatabases(input, ...args); +}; +export async function* getDatabasesPaginate( + config: GluePaginationConfiguration, + input: GetDatabasesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetDatabasesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Glue) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof GlueClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Glue | GlueClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-glue/pagination/GetDevEndpointsPaginator.ts b/clients/client-glue/pagination/GetDevEndpointsPaginator.ts new file mode 100644 index 0000000000000..051da238bfb93 --- /dev/null +++ b/clients/client-glue/pagination/GetDevEndpointsPaginator.ts @@ -0,0 +1,51 @@ +import { Glue } from "../Glue"; +import { GlueClient } from "../GlueClient"; +import { + GetDevEndpointsCommand, + GetDevEndpointsCommandInput, + GetDevEndpointsCommandOutput, +} from "../commands/GetDevEndpointsCommand"; +import { GluePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: GlueClient, + input: GetDevEndpointsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetDevEndpointsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Glue, + input: GetDevEndpointsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getDevEndpoints(input, ...args); +}; +export async function* getDevEndpointsPaginate( + config: GluePaginationConfiguration, + input: GetDevEndpointsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetDevEndpointsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Glue) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof GlueClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Glue | GlueClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-glue/pagination/GetJobRunsPaginator.ts b/clients/client-glue/pagination/GetJobRunsPaginator.ts new file mode 100644 index 0000000000000..7bb89b9c224de --- /dev/null +++ b/clients/client-glue/pagination/GetJobRunsPaginator.ts @@ -0,0 +1,47 @@ +import { Glue } from "../Glue"; +import { GlueClient } from "../GlueClient"; +import { GetJobRunsCommand, GetJobRunsCommandInput, GetJobRunsCommandOutput } from "../commands/GetJobRunsCommand"; +import { GluePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: GlueClient, + input: GetJobRunsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetJobRunsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Glue, + input: GetJobRunsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getJobRuns(input, ...args); +}; +export async function* getJobRunsPaginate( + config: GluePaginationConfiguration, + input: GetJobRunsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetJobRunsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Glue) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof GlueClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Glue | GlueClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-glue/pagination/GetJobsPaginator.ts b/clients/client-glue/pagination/GetJobsPaginator.ts new file mode 100644 index 0000000000000..38091feff8d72 --- /dev/null +++ b/clients/client-glue/pagination/GetJobsPaginator.ts @@ -0,0 +1,47 @@ +import { Glue } from "../Glue"; +import { GlueClient } from "../GlueClient"; +import { GetJobsCommand, GetJobsCommandInput, GetJobsCommandOutput } from "../commands/GetJobsCommand"; +import { GluePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: GlueClient, + input: GetJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetJobsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Glue, + input: GetJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getJobs(input, ...args); +}; +export async function* getJobsPaginate( + config: GluePaginationConfiguration, + input: GetJobsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetJobsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Glue) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof GlueClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Glue | GlueClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-glue/pagination/GetMLTaskRunsPaginator.ts b/clients/client-glue/pagination/GetMLTaskRunsPaginator.ts new file mode 100644 index 0000000000000..b7a829166e2b1 --- /dev/null +++ b/clients/client-glue/pagination/GetMLTaskRunsPaginator.ts @@ -0,0 +1,51 @@ +import { Glue } from "../Glue"; +import { GlueClient } from "../GlueClient"; +import { + GetMLTaskRunsCommand, + GetMLTaskRunsCommandInput, + GetMLTaskRunsCommandOutput, +} from "../commands/GetMLTaskRunsCommand"; +import { GluePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: GlueClient, + input: GetMLTaskRunsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetMLTaskRunsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Glue, + input: GetMLTaskRunsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getMLTaskRuns(input, ...args); +}; +export async function* getMLTaskRunsPaginate( + config: GluePaginationConfiguration, + input: GetMLTaskRunsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetMLTaskRunsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Glue) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof GlueClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Glue | GlueClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-glue/pagination/GetMLTransformsPaginator.ts b/clients/client-glue/pagination/GetMLTransformsPaginator.ts new file mode 100644 index 0000000000000..30b3772758982 --- /dev/null +++ b/clients/client-glue/pagination/GetMLTransformsPaginator.ts @@ -0,0 +1,51 @@ +import { Glue } from "../Glue"; +import { GlueClient } from "../GlueClient"; +import { + GetMLTransformsCommand, + GetMLTransformsCommandInput, + GetMLTransformsCommandOutput, +} from "../commands/GetMLTransformsCommand"; +import { GluePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: GlueClient, + input: GetMLTransformsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetMLTransformsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Glue, + input: GetMLTransformsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getMLTransforms(input, ...args); +}; +export async function* getMLTransformsPaginate( + config: GluePaginationConfiguration, + input: GetMLTransformsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetMLTransformsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Glue) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof GlueClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Glue | GlueClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-glue/pagination/GetPartitionsPaginator.ts b/clients/client-glue/pagination/GetPartitionsPaginator.ts new file mode 100644 index 0000000000000..e3fe98d530a32 --- /dev/null +++ b/clients/client-glue/pagination/GetPartitionsPaginator.ts @@ -0,0 +1,51 @@ +import { Glue } from "../Glue"; +import { GlueClient } from "../GlueClient"; +import { + GetPartitionsCommand, + GetPartitionsCommandInput, + GetPartitionsCommandOutput, +} from "../commands/GetPartitionsCommand"; +import { GluePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: GlueClient, + input: GetPartitionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetPartitionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Glue, + input: GetPartitionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getPartitions(input, ...args); +}; +export async function* getPartitionsPaginate( + config: GluePaginationConfiguration, + input: GetPartitionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetPartitionsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Glue) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof GlueClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Glue | GlueClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-glue/pagination/GetTableVersionsPaginator.ts b/clients/client-glue/pagination/GetTableVersionsPaginator.ts new file mode 100644 index 0000000000000..49c78368b9946 --- /dev/null +++ b/clients/client-glue/pagination/GetTableVersionsPaginator.ts @@ -0,0 +1,51 @@ +import { Glue } from "../Glue"; +import { GlueClient } from "../GlueClient"; +import { + GetTableVersionsCommand, + GetTableVersionsCommandInput, + GetTableVersionsCommandOutput, +} from "../commands/GetTableVersionsCommand"; +import { GluePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: GlueClient, + input: GetTableVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetTableVersionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Glue, + input: GetTableVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getTableVersions(input, ...args); +}; +export async function* getTableVersionsPaginate( + config: GluePaginationConfiguration, + input: GetTableVersionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetTableVersionsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Glue) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof GlueClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Glue | GlueClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-glue/pagination/GetTablesPaginator.ts b/clients/client-glue/pagination/GetTablesPaginator.ts new file mode 100644 index 0000000000000..7344f25e466f2 --- /dev/null +++ b/clients/client-glue/pagination/GetTablesPaginator.ts @@ -0,0 +1,47 @@ +import { Glue } from "../Glue"; +import { GlueClient } from "../GlueClient"; +import { GetTablesCommand, GetTablesCommandInput, GetTablesCommandOutput } from "../commands/GetTablesCommand"; +import { GluePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: GlueClient, + input: GetTablesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetTablesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Glue, + input: GetTablesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getTables(input, ...args); +}; +export async function* getTablesPaginate( + config: GluePaginationConfiguration, + input: GetTablesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetTablesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Glue) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof GlueClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Glue | GlueClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-glue/pagination/GetTriggersPaginator.ts b/clients/client-glue/pagination/GetTriggersPaginator.ts new file mode 100644 index 0000000000000..098c479022725 --- /dev/null +++ b/clients/client-glue/pagination/GetTriggersPaginator.ts @@ -0,0 +1,47 @@ +import { Glue } from "../Glue"; +import { GlueClient } from "../GlueClient"; +import { GetTriggersCommand, GetTriggersCommandInput, GetTriggersCommandOutput } from "../commands/GetTriggersCommand"; +import { GluePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: GlueClient, + input: GetTriggersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetTriggersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Glue, + input: GetTriggersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getTriggers(input, ...args); +}; +export async function* getTriggersPaginate( + config: GluePaginationConfiguration, + input: GetTriggersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetTriggersCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Glue) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof GlueClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Glue | GlueClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-glue/pagination/GetUserDefinedFunctionsPaginator.ts b/clients/client-glue/pagination/GetUserDefinedFunctionsPaginator.ts new file mode 100644 index 0000000000000..74f10ea64ed61 --- /dev/null +++ b/clients/client-glue/pagination/GetUserDefinedFunctionsPaginator.ts @@ -0,0 +1,51 @@ +import { Glue } from "../Glue"; +import { GlueClient } from "../GlueClient"; +import { + GetUserDefinedFunctionsCommand, + GetUserDefinedFunctionsCommandInput, + GetUserDefinedFunctionsCommandOutput, +} from "../commands/GetUserDefinedFunctionsCommand"; +import { GluePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: GlueClient, + input: GetUserDefinedFunctionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetUserDefinedFunctionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Glue, + input: GetUserDefinedFunctionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getUserDefinedFunctions(input, ...args); +}; +export async function* getUserDefinedFunctionsPaginate( + config: GluePaginationConfiguration, + input: GetUserDefinedFunctionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetUserDefinedFunctionsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Glue) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof GlueClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Glue | GlueClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-glue/pagination/GetWorkflowRunsPaginator.ts b/clients/client-glue/pagination/GetWorkflowRunsPaginator.ts new file mode 100644 index 0000000000000..7cab18724aafe --- /dev/null +++ b/clients/client-glue/pagination/GetWorkflowRunsPaginator.ts @@ -0,0 +1,51 @@ +import { Glue } from "../Glue"; +import { GlueClient } from "../GlueClient"; +import { + GetWorkflowRunsCommand, + GetWorkflowRunsCommandInput, + GetWorkflowRunsCommandOutput, +} from "../commands/GetWorkflowRunsCommand"; +import { GluePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: GlueClient, + input: GetWorkflowRunsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetWorkflowRunsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Glue, + input: GetWorkflowRunsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getWorkflowRuns(input, ...args); +}; +export async function* getWorkflowRunsPaginate( + config: GluePaginationConfiguration, + input: GetWorkflowRunsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetWorkflowRunsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Glue) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof GlueClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Glue | GlueClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-glue/pagination/Interfaces.ts b/clients/client-glue/pagination/Interfaces.ts new file mode 100644 index 0000000000000..8d649a4b3fd5b --- /dev/null +++ b/clients/client-glue/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { Glue } from "../Glue"; +import { GlueClient } from "../GlueClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface GluePaginationConfiguration extends PaginationConfiguration { + client: Glue | GlueClient; +} diff --git a/clients/client-glue/pagination/ListCrawlersPaginator.ts b/clients/client-glue/pagination/ListCrawlersPaginator.ts new file mode 100644 index 0000000000000..aa3b01d0fe87e --- /dev/null +++ b/clients/client-glue/pagination/ListCrawlersPaginator.ts @@ -0,0 +1,51 @@ +import { Glue } from "../Glue"; +import { GlueClient } from "../GlueClient"; +import { + ListCrawlersCommand, + ListCrawlersCommandInput, + ListCrawlersCommandOutput, +} from "../commands/ListCrawlersCommand"; +import { GluePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: GlueClient, + input: ListCrawlersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListCrawlersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Glue, + input: ListCrawlersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listCrawlers(input, ...args); +}; +export async function* listCrawlersPaginate( + config: GluePaginationConfiguration, + input: ListCrawlersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListCrawlersCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Glue) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof GlueClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Glue | GlueClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-glue/pagination/ListDevEndpointsPaginator.ts b/clients/client-glue/pagination/ListDevEndpointsPaginator.ts new file mode 100644 index 0000000000000..971f5756928b8 --- /dev/null +++ b/clients/client-glue/pagination/ListDevEndpointsPaginator.ts @@ -0,0 +1,51 @@ +import { Glue } from "../Glue"; +import { GlueClient } from "../GlueClient"; +import { + ListDevEndpointsCommand, + ListDevEndpointsCommandInput, + ListDevEndpointsCommandOutput, +} from "../commands/ListDevEndpointsCommand"; +import { GluePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: GlueClient, + input: ListDevEndpointsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDevEndpointsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Glue, + input: ListDevEndpointsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDevEndpoints(input, ...args); +}; +export async function* listDevEndpointsPaginate( + config: GluePaginationConfiguration, + input: ListDevEndpointsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDevEndpointsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Glue) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof GlueClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Glue | GlueClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-glue/pagination/ListJobsPaginator.ts b/clients/client-glue/pagination/ListJobsPaginator.ts new file mode 100644 index 0000000000000..3fefcaa448114 --- /dev/null +++ b/clients/client-glue/pagination/ListJobsPaginator.ts @@ -0,0 +1,47 @@ +import { Glue } from "../Glue"; +import { GlueClient } from "../GlueClient"; +import { ListJobsCommand, ListJobsCommandInput, ListJobsCommandOutput } from "../commands/ListJobsCommand"; +import { GluePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: GlueClient, + input: ListJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListJobsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Glue, + input: ListJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listJobs(input, ...args); +}; +export async function* listJobsPaginate( + config: GluePaginationConfiguration, + input: ListJobsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListJobsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Glue) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof GlueClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Glue | GlueClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-glue/pagination/ListMLTransformsPaginator.ts b/clients/client-glue/pagination/ListMLTransformsPaginator.ts new file mode 100644 index 0000000000000..716a9f2695270 --- /dev/null +++ b/clients/client-glue/pagination/ListMLTransformsPaginator.ts @@ -0,0 +1,51 @@ +import { Glue } from "../Glue"; +import { GlueClient } from "../GlueClient"; +import { + ListMLTransformsCommand, + ListMLTransformsCommandInput, + ListMLTransformsCommandOutput, +} from "../commands/ListMLTransformsCommand"; +import { GluePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: GlueClient, + input: ListMLTransformsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListMLTransformsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Glue, + input: ListMLTransformsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listMLTransforms(input, ...args); +}; +export async function* listMLTransformsPaginate( + config: GluePaginationConfiguration, + input: ListMLTransformsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListMLTransformsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Glue) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof GlueClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Glue | GlueClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-glue/pagination/ListTriggersPaginator.ts b/clients/client-glue/pagination/ListTriggersPaginator.ts new file mode 100644 index 0000000000000..110857cd6e537 --- /dev/null +++ b/clients/client-glue/pagination/ListTriggersPaginator.ts @@ -0,0 +1,51 @@ +import { Glue } from "../Glue"; +import { GlueClient } from "../GlueClient"; +import { + ListTriggersCommand, + ListTriggersCommandInput, + ListTriggersCommandOutput, +} from "../commands/ListTriggersCommand"; +import { GluePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: GlueClient, + input: ListTriggersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTriggersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Glue, + input: ListTriggersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTriggers(input, ...args); +}; +export async function* listTriggersPaginate( + config: GluePaginationConfiguration, + input: ListTriggersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTriggersCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Glue) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof GlueClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Glue | GlueClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-glue/pagination/ListWorkflowsPaginator.ts b/clients/client-glue/pagination/ListWorkflowsPaginator.ts new file mode 100644 index 0000000000000..3eeab28289dfd --- /dev/null +++ b/clients/client-glue/pagination/ListWorkflowsPaginator.ts @@ -0,0 +1,51 @@ +import { Glue } from "../Glue"; +import { GlueClient } from "../GlueClient"; +import { + ListWorkflowsCommand, + ListWorkflowsCommandInput, + ListWorkflowsCommandOutput, +} from "../commands/ListWorkflowsCommand"; +import { GluePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: GlueClient, + input: ListWorkflowsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListWorkflowsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Glue, + input: ListWorkflowsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listWorkflows(input, ...args); +}; +export async function* listWorkflowsPaginate( + config: GluePaginationConfiguration, + input: ListWorkflowsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListWorkflowsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Glue) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof GlueClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Glue | GlueClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-glue/pagination/SearchTablesPaginator.ts b/clients/client-glue/pagination/SearchTablesPaginator.ts new file mode 100644 index 0000000000000..a56e77b4d7bad --- /dev/null +++ b/clients/client-glue/pagination/SearchTablesPaginator.ts @@ -0,0 +1,51 @@ +import { Glue } from "../Glue"; +import { GlueClient } from "../GlueClient"; +import { + SearchTablesCommand, + SearchTablesCommandInput, + SearchTablesCommandOutput, +} from "../commands/SearchTablesCommand"; +import { GluePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: GlueClient, + input: SearchTablesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new SearchTablesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Glue, + input: SearchTablesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.searchTables(input, ...args); +}; +export async function* searchTablesPaginate( + config: GluePaginationConfiguration, + input: SearchTablesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: SearchTablesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Glue) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof GlueClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Glue | GlueClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-groundstation/index.ts b/clients/client-groundstation/index.ts index a24dbf4485a46..df44908ef4512 100644 --- a/clients/client-groundstation/index.ts +++ b/clients/client-groundstation/index.ts @@ -14,15 +14,22 @@ export * from "./commands/GetMinuteUsageCommand"; export * from "./commands/GetMissionProfileCommand"; export * from "./commands/GetSatelliteCommand"; export * from "./commands/ListConfigsCommand"; +export * from "./pagination/ListConfigsPaginator"; export * from "./commands/ListContactsCommand"; +export * from "./pagination/ListContactsPaginator"; export * from "./commands/ListDataflowEndpointGroupsCommand"; +export * from "./pagination/ListDataflowEndpointGroupsPaginator"; export * from "./commands/ListGroundStationsCommand"; +export * from "./pagination/ListGroundStationsPaginator"; export * from "./commands/ListMissionProfilesCommand"; +export * from "./pagination/ListMissionProfilesPaginator"; export * from "./commands/ListSatellitesCommand"; +export * from "./pagination/ListSatellitesPaginator"; export * from "./commands/ListTagsForResourceCommand"; export * from "./commands/ReserveContactCommand"; export * from "./commands/TagResourceCommand"; export * from "./commands/UntagResourceCommand"; export * from "./commands/UpdateConfigCommand"; export * from "./commands/UpdateMissionProfileCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-groundstation/pagination/Interfaces.ts b/clients/client-groundstation/pagination/Interfaces.ts new file mode 100644 index 0000000000000..39a856a06eb05 --- /dev/null +++ b/clients/client-groundstation/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { GroundStation } from "../GroundStation"; +import { GroundStationClient } from "../GroundStationClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface GroundStationPaginationConfiguration extends PaginationConfiguration { + client: GroundStation | GroundStationClient; +} diff --git a/clients/client-groundstation/pagination/ListConfigsPaginator.ts b/clients/client-groundstation/pagination/ListConfigsPaginator.ts new file mode 100644 index 0000000000000..d27daa2aed4d1 --- /dev/null +++ b/clients/client-groundstation/pagination/ListConfigsPaginator.ts @@ -0,0 +1,47 @@ +import { GroundStation } from "../GroundStation"; +import { GroundStationClient } from "../GroundStationClient"; +import { ListConfigsCommand, ListConfigsCommandInput, ListConfigsCommandOutput } from "../commands/ListConfigsCommand"; +import { GroundStationPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: GroundStationClient, + input: ListConfigsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListConfigsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: GroundStation, + input: ListConfigsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listConfigs(input, ...args); +}; +export async function* listConfigsPaginate( + config: GroundStationPaginationConfiguration, + input: ListConfigsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListConfigsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof GroundStation) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof GroundStationClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected GroundStation | GroundStationClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-groundstation/pagination/ListContactsPaginator.ts b/clients/client-groundstation/pagination/ListContactsPaginator.ts new file mode 100644 index 0000000000000..48b44c2c2cdbd --- /dev/null +++ b/clients/client-groundstation/pagination/ListContactsPaginator.ts @@ -0,0 +1,51 @@ +import { GroundStation } from "../GroundStation"; +import { GroundStationClient } from "../GroundStationClient"; +import { + ListContactsCommand, + ListContactsCommandInput, + ListContactsCommandOutput, +} from "../commands/ListContactsCommand"; +import { GroundStationPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: GroundStationClient, + input: ListContactsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListContactsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: GroundStation, + input: ListContactsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listContacts(input, ...args); +}; +export async function* listContactsPaginate( + config: GroundStationPaginationConfiguration, + input: ListContactsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListContactsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof GroundStation) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof GroundStationClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected GroundStation | GroundStationClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-groundstation/pagination/ListDataflowEndpointGroupsPaginator.ts b/clients/client-groundstation/pagination/ListDataflowEndpointGroupsPaginator.ts new file mode 100644 index 0000000000000..c69dc604fea6f --- /dev/null +++ b/clients/client-groundstation/pagination/ListDataflowEndpointGroupsPaginator.ts @@ -0,0 +1,51 @@ +import { GroundStation } from "../GroundStation"; +import { GroundStationClient } from "../GroundStationClient"; +import { + ListDataflowEndpointGroupsCommand, + ListDataflowEndpointGroupsCommandInput, + ListDataflowEndpointGroupsCommandOutput, +} from "../commands/ListDataflowEndpointGroupsCommand"; +import { GroundStationPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: GroundStationClient, + input: ListDataflowEndpointGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDataflowEndpointGroupsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: GroundStation, + input: ListDataflowEndpointGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDataflowEndpointGroups(input, ...args); +}; +export async function* listDataflowEndpointGroupsPaginate( + config: GroundStationPaginationConfiguration, + input: ListDataflowEndpointGroupsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDataflowEndpointGroupsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof GroundStation) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof GroundStationClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected GroundStation | GroundStationClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-groundstation/pagination/ListGroundStationsPaginator.ts b/clients/client-groundstation/pagination/ListGroundStationsPaginator.ts new file mode 100644 index 0000000000000..0742f978d707e --- /dev/null +++ b/clients/client-groundstation/pagination/ListGroundStationsPaginator.ts @@ -0,0 +1,51 @@ +import { GroundStation } from "../GroundStation"; +import { GroundStationClient } from "../GroundStationClient"; +import { + ListGroundStationsCommand, + ListGroundStationsCommandInput, + ListGroundStationsCommandOutput, +} from "../commands/ListGroundStationsCommand"; +import { GroundStationPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: GroundStationClient, + input: ListGroundStationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListGroundStationsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: GroundStation, + input: ListGroundStationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listGroundStations(input, ...args); +}; +export async function* listGroundStationsPaginate( + config: GroundStationPaginationConfiguration, + input: ListGroundStationsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListGroundStationsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof GroundStation) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof GroundStationClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected GroundStation | GroundStationClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-groundstation/pagination/ListMissionProfilesPaginator.ts b/clients/client-groundstation/pagination/ListMissionProfilesPaginator.ts new file mode 100644 index 0000000000000..0e62922673971 --- /dev/null +++ b/clients/client-groundstation/pagination/ListMissionProfilesPaginator.ts @@ -0,0 +1,51 @@ +import { GroundStation } from "../GroundStation"; +import { GroundStationClient } from "../GroundStationClient"; +import { + ListMissionProfilesCommand, + ListMissionProfilesCommandInput, + ListMissionProfilesCommandOutput, +} from "../commands/ListMissionProfilesCommand"; +import { GroundStationPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: GroundStationClient, + input: ListMissionProfilesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListMissionProfilesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: GroundStation, + input: ListMissionProfilesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listMissionProfiles(input, ...args); +}; +export async function* listMissionProfilesPaginate( + config: GroundStationPaginationConfiguration, + input: ListMissionProfilesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListMissionProfilesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof GroundStation) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof GroundStationClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected GroundStation | GroundStationClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-groundstation/pagination/ListSatellitesPaginator.ts b/clients/client-groundstation/pagination/ListSatellitesPaginator.ts new file mode 100644 index 0000000000000..fc83596afe8a1 --- /dev/null +++ b/clients/client-groundstation/pagination/ListSatellitesPaginator.ts @@ -0,0 +1,51 @@ +import { GroundStation } from "../GroundStation"; +import { GroundStationClient } from "../GroundStationClient"; +import { + ListSatellitesCommand, + ListSatellitesCommandInput, + ListSatellitesCommandOutput, +} from "../commands/ListSatellitesCommand"; +import { GroundStationPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: GroundStationClient, + input: ListSatellitesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListSatellitesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: GroundStation, + input: ListSatellitesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listSatellites(input, ...args); +}; +export async function* listSatellitesPaginate( + config: GroundStationPaginationConfiguration, + input: ListSatellitesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListSatellitesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof GroundStation) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof GroundStationClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected GroundStation | GroundStationClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-guardduty/index.ts b/clients/client-guardduty/index.ts index c34223f181bc1..0e2e22db20d48 100644 --- a/clients/client-guardduty/index.ts +++ b/clients/client-guardduty/index.ts @@ -34,17 +34,27 @@ export * from "./commands/GetMemberDetectorsCommand"; export * from "./commands/GetMembersCommand"; export * from "./commands/GetThreatIntelSetCommand"; export * from "./commands/GetUsageStatisticsCommand"; +export * from "./pagination/GetUsageStatisticsPaginator"; export * from "./commands/InviteMembersCommand"; export * from "./commands/ListDetectorsCommand"; +export * from "./pagination/ListDetectorsPaginator"; export * from "./commands/ListFiltersCommand"; +export * from "./pagination/ListFiltersPaginator"; export * from "./commands/ListFindingsCommand"; +export * from "./pagination/ListFindingsPaginator"; export * from "./commands/ListInvitationsCommand"; +export * from "./pagination/ListInvitationsPaginator"; export * from "./commands/ListIPSetsCommand"; +export * from "./pagination/ListIPSetsPaginator"; export * from "./commands/ListMembersCommand"; +export * from "./pagination/ListMembersPaginator"; export * from "./commands/ListOrganizationAdminAccountsCommand"; +export * from "./pagination/ListOrganizationAdminAccountsPaginator"; export * from "./commands/ListPublishingDestinationsCommand"; +export * from "./pagination/ListPublishingDestinationsPaginator"; export * from "./commands/ListTagsForResourceCommand"; export * from "./commands/ListThreatIntelSetsCommand"; +export * from "./pagination/ListThreatIntelSetsPaginator"; export * from "./commands/StartMonitoringMembersCommand"; export * from "./commands/StopMonitoringMembersCommand"; export * from "./commands/TagResourceCommand"; @@ -58,4 +68,5 @@ export * from "./commands/UpdateMemberDetectorsCommand"; export * from "./commands/UpdateOrganizationConfigurationCommand"; export * from "./commands/UpdatePublishingDestinationCommand"; export * from "./commands/UpdateThreatIntelSetCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-guardduty/pagination/GetUsageStatisticsPaginator.ts b/clients/client-guardduty/pagination/GetUsageStatisticsPaginator.ts new file mode 100644 index 0000000000000..c8c07cfd9d337 --- /dev/null +++ b/clients/client-guardduty/pagination/GetUsageStatisticsPaginator.ts @@ -0,0 +1,51 @@ +import { GuardDuty } from "../GuardDuty"; +import { GuardDutyClient } from "../GuardDutyClient"; +import { + GetUsageStatisticsCommand, + GetUsageStatisticsCommandInput, + GetUsageStatisticsCommandOutput, +} from "../commands/GetUsageStatisticsCommand"; +import { GuardDutyPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: GuardDutyClient, + input: GetUsageStatisticsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetUsageStatisticsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: GuardDuty, + input: GetUsageStatisticsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getUsageStatistics(input, ...args); +}; +export async function* getUsageStatisticsPaginate( + config: GuardDutyPaginationConfiguration, + input: GetUsageStatisticsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetUsageStatisticsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof GuardDuty) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof GuardDutyClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected GuardDuty | GuardDutyClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-guardduty/pagination/Interfaces.ts b/clients/client-guardduty/pagination/Interfaces.ts new file mode 100644 index 0000000000000..adae50de2fe4a --- /dev/null +++ b/clients/client-guardduty/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { GuardDuty } from "../GuardDuty"; +import { GuardDutyClient } from "../GuardDutyClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface GuardDutyPaginationConfiguration extends PaginationConfiguration { + client: GuardDuty | GuardDutyClient; +} diff --git a/clients/client-guardduty/pagination/ListDetectorsPaginator.ts b/clients/client-guardduty/pagination/ListDetectorsPaginator.ts new file mode 100644 index 0000000000000..1b64fd396ddb8 --- /dev/null +++ b/clients/client-guardduty/pagination/ListDetectorsPaginator.ts @@ -0,0 +1,51 @@ +import { GuardDuty } from "../GuardDuty"; +import { GuardDutyClient } from "../GuardDutyClient"; +import { + ListDetectorsCommand, + ListDetectorsCommandInput, + ListDetectorsCommandOutput, +} from "../commands/ListDetectorsCommand"; +import { GuardDutyPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: GuardDutyClient, + input: ListDetectorsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDetectorsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: GuardDuty, + input: ListDetectorsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDetectors(input, ...args); +}; +export async function* listDetectorsPaginate( + config: GuardDutyPaginationConfiguration, + input: ListDetectorsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDetectorsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof GuardDuty) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof GuardDutyClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected GuardDuty | GuardDutyClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-guardduty/pagination/ListFiltersPaginator.ts b/clients/client-guardduty/pagination/ListFiltersPaginator.ts new file mode 100644 index 0000000000000..ef648dba36416 --- /dev/null +++ b/clients/client-guardduty/pagination/ListFiltersPaginator.ts @@ -0,0 +1,47 @@ +import { GuardDuty } from "../GuardDuty"; +import { GuardDutyClient } from "../GuardDutyClient"; +import { ListFiltersCommand, ListFiltersCommandInput, ListFiltersCommandOutput } from "../commands/ListFiltersCommand"; +import { GuardDutyPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: GuardDutyClient, + input: ListFiltersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListFiltersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: GuardDuty, + input: ListFiltersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listFilters(input, ...args); +}; +export async function* listFiltersPaginate( + config: GuardDutyPaginationConfiguration, + input: ListFiltersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListFiltersCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof GuardDuty) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof GuardDutyClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected GuardDuty | GuardDutyClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-guardduty/pagination/ListFindingsPaginator.ts b/clients/client-guardduty/pagination/ListFindingsPaginator.ts new file mode 100644 index 0000000000000..496f517bb7769 --- /dev/null +++ b/clients/client-guardduty/pagination/ListFindingsPaginator.ts @@ -0,0 +1,51 @@ +import { GuardDuty } from "../GuardDuty"; +import { GuardDutyClient } from "../GuardDutyClient"; +import { + ListFindingsCommand, + ListFindingsCommandInput, + ListFindingsCommandOutput, +} from "../commands/ListFindingsCommand"; +import { GuardDutyPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: GuardDutyClient, + input: ListFindingsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListFindingsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: GuardDuty, + input: ListFindingsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listFindings(input, ...args); +}; +export async function* listFindingsPaginate( + config: GuardDutyPaginationConfiguration, + input: ListFindingsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListFindingsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof GuardDuty) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof GuardDutyClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected GuardDuty | GuardDutyClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-guardduty/pagination/ListIPSetsPaginator.ts b/clients/client-guardduty/pagination/ListIPSetsPaginator.ts new file mode 100644 index 0000000000000..eba5ab08b6045 --- /dev/null +++ b/clients/client-guardduty/pagination/ListIPSetsPaginator.ts @@ -0,0 +1,47 @@ +import { GuardDuty } from "../GuardDuty"; +import { GuardDutyClient } from "../GuardDutyClient"; +import { ListIPSetsCommand, ListIPSetsCommandInput, ListIPSetsCommandOutput } from "../commands/ListIPSetsCommand"; +import { GuardDutyPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: GuardDutyClient, + input: ListIPSetsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListIPSetsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: GuardDuty, + input: ListIPSetsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listIPSets(input, ...args); +}; +export async function* listIPSetsPaginate( + config: GuardDutyPaginationConfiguration, + input: ListIPSetsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListIPSetsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof GuardDuty) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof GuardDutyClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected GuardDuty | GuardDutyClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-guardduty/pagination/ListInvitationsPaginator.ts b/clients/client-guardduty/pagination/ListInvitationsPaginator.ts new file mode 100644 index 0000000000000..f13dc8637088e --- /dev/null +++ b/clients/client-guardduty/pagination/ListInvitationsPaginator.ts @@ -0,0 +1,51 @@ +import { GuardDuty } from "../GuardDuty"; +import { GuardDutyClient } from "../GuardDutyClient"; +import { + ListInvitationsCommand, + ListInvitationsCommandInput, + ListInvitationsCommandOutput, +} from "../commands/ListInvitationsCommand"; +import { GuardDutyPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: GuardDutyClient, + input: ListInvitationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListInvitationsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: GuardDuty, + input: ListInvitationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listInvitations(input, ...args); +}; +export async function* listInvitationsPaginate( + config: GuardDutyPaginationConfiguration, + input: ListInvitationsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListInvitationsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof GuardDuty) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof GuardDutyClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected GuardDuty | GuardDutyClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-guardduty/pagination/ListMembersPaginator.ts b/clients/client-guardduty/pagination/ListMembersPaginator.ts new file mode 100644 index 0000000000000..236ce50f385af --- /dev/null +++ b/clients/client-guardduty/pagination/ListMembersPaginator.ts @@ -0,0 +1,47 @@ +import { GuardDuty } from "../GuardDuty"; +import { GuardDutyClient } from "../GuardDutyClient"; +import { ListMembersCommand, ListMembersCommandInput, ListMembersCommandOutput } from "../commands/ListMembersCommand"; +import { GuardDutyPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: GuardDutyClient, + input: ListMembersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListMembersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: GuardDuty, + input: ListMembersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listMembers(input, ...args); +}; +export async function* listMembersPaginate( + config: GuardDutyPaginationConfiguration, + input: ListMembersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListMembersCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof GuardDuty) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof GuardDutyClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected GuardDuty | GuardDutyClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-guardduty/pagination/ListOrganizationAdminAccountsPaginator.ts b/clients/client-guardduty/pagination/ListOrganizationAdminAccountsPaginator.ts new file mode 100644 index 0000000000000..7c6a1d85509c9 --- /dev/null +++ b/clients/client-guardduty/pagination/ListOrganizationAdminAccountsPaginator.ts @@ -0,0 +1,51 @@ +import { GuardDuty } from "../GuardDuty"; +import { GuardDutyClient } from "../GuardDutyClient"; +import { + ListOrganizationAdminAccountsCommand, + ListOrganizationAdminAccountsCommandInput, + ListOrganizationAdminAccountsCommandOutput, +} from "../commands/ListOrganizationAdminAccountsCommand"; +import { GuardDutyPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: GuardDutyClient, + input: ListOrganizationAdminAccountsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListOrganizationAdminAccountsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: GuardDuty, + input: ListOrganizationAdminAccountsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listOrganizationAdminAccounts(input, ...args); +}; +export async function* listOrganizationAdminAccountsPaginate( + config: GuardDutyPaginationConfiguration, + input: ListOrganizationAdminAccountsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListOrganizationAdminAccountsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof GuardDuty) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof GuardDutyClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected GuardDuty | GuardDutyClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-guardduty/pagination/ListPublishingDestinationsPaginator.ts b/clients/client-guardduty/pagination/ListPublishingDestinationsPaginator.ts new file mode 100644 index 0000000000000..797ca5130454d --- /dev/null +++ b/clients/client-guardduty/pagination/ListPublishingDestinationsPaginator.ts @@ -0,0 +1,51 @@ +import { GuardDuty } from "../GuardDuty"; +import { GuardDutyClient } from "../GuardDutyClient"; +import { + ListPublishingDestinationsCommand, + ListPublishingDestinationsCommandInput, + ListPublishingDestinationsCommandOutput, +} from "../commands/ListPublishingDestinationsCommand"; +import { GuardDutyPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: GuardDutyClient, + input: ListPublishingDestinationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListPublishingDestinationsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: GuardDuty, + input: ListPublishingDestinationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listPublishingDestinations(input, ...args); +}; +export async function* listPublishingDestinationsPaginate( + config: GuardDutyPaginationConfiguration, + input: ListPublishingDestinationsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListPublishingDestinationsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof GuardDuty) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof GuardDutyClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected GuardDuty | GuardDutyClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-guardduty/pagination/ListThreatIntelSetsPaginator.ts b/clients/client-guardduty/pagination/ListThreatIntelSetsPaginator.ts new file mode 100644 index 0000000000000..b1b9f30586c3d --- /dev/null +++ b/clients/client-guardduty/pagination/ListThreatIntelSetsPaginator.ts @@ -0,0 +1,51 @@ +import { GuardDuty } from "../GuardDuty"; +import { GuardDutyClient } from "../GuardDutyClient"; +import { + ListThreatIntelSetsCommand, + ListThreatIntelSetsCommandInput, + ListThreatIntelSetsCommandOutput, +} from "../commands/ListThreatIntelSetsCommand"; +import { GuardDutyPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: GuardDutyClient, + input: ListThreatIntelSetsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListThreatIntelSetsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: GuardDuty, + input: ListThreatIntelSetsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listThreatIntelSets(input, ...args); +}; +export async function* listThreatIntelSetsPaginate( + config: GuardDutyPaginationConfiguration, + input: ListThreatIntelSetsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListThreatIntelSetsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof GuardDuty) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof GuardDutyClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected GuardDuty | GuardDutyClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iam/index.ts b/clients/client-iam/index.ts index d22594eb0dcf5..cf7d138707715 100644 --- a/clients/client-iam/index.ts +++ b/clients/client-iam/index.ts @@ -54,12 +54,14 @@ export * from "./commands/GenerateOrganizationsAccessReportCommand"; export * from "./commands/GenerateServiceLastAccessedDetailsCommand"; export * from "./commands/GetAccessKeyLastUsedCommand"; export * from "./commands/GetAccountAuthorizationDetailsCommand"; +export * from "./pagination/GetAccountAuthorizationDetailsPaginator"; export * from "./commands/GetAccountPasswordPolicyCommand"; export * from "./commands/GetAccountSummaryCommand"; export * from "./commands/GetContextKeysForCustomPolicyCommand"; export * from "./commands/GetContextKeysForPrincipalPolicyCommand"; export * from "./commands/GetCredentialReportCommand"; export * from "./commands/GetGroupCommand"; +export * from "./pagination/GetGroupPaginator"; export * from "./commands/GetGroupPolicyCommand"; export * from "./commands/GetInstanceProfileCommand"; export * from "./commands/GetLoginProfileCommand"; @@ -78,33 +80,55 @@ export * from "./commands/GetSSHPublicKeyCommand"; export * from "./commands/GetUserCommand"; export * from "./commands/GetUserPolicyCommand"; export * from "./commands/ListAccessKeysCommand"; +export * from "./pagination/ListAccessKeysPaginator"; export * from "./commands/ListAccountAliasesCommand"; +export * from "./pagination/ListAccountAliasesPaginator"; export * from "./commands/ListAttachedGroupPoliciesCommand"; +export * from "./pagination/ListAttachedGroupPoliciesPaginator"; export * from "./commands/ListAttachedRolePoliciesCommand"; +export * from "./pagination/ListAttachedRolePoliciesPaginator"; export * from "./commands/ListAttachedUserPoliciesCommand"; +export * from "./pagination/ListAttachedUserPoliciesPaginator"; export * from "./commands/ListEntitiesForPolicyCommand"; +export * from "./pagination/ListEntitiesForPolicyPaginator"; export * from "./commands/ListGroupPoliciesCommand"; +export * from "./pagination/ListGroupPoliciesPaginator"; export * from "./commands/ListGroupsCommand"; +export * from "./pagination/ListGroupsPaginator"; export * from "./commands/ListGroupsForUserCommand"; +export * from "./pagination/ListGroupsForUserPaginator"; export * from "./commands/ListInstanceProfilesCommand"; +export * from "./pagination/ListInstanceProfilesPaginator"; export * from "./commands/ListInstanceProfilesForRoleCommand"; +export * from "./pagination/ListInstanceProfilesForRolePaginator"; export * from "./commands/ListMFADevicesCommand"; +export * from "./pagination/ListMFADevicesPaginator"; export * from "./commands/ListOpenIDConnectProvidersCommand"; export * from "./commands/ListPoliciesCommand"; +export * from "./pagination/ListPoliciesPaginator"; export * from "./commands/ListPoliciesGrantingServiceAccessCommand"; export * from "./commands/ListPolicyVersionsCommand"; +export * from "./pagination/ListPolicyVersionsPaginator"; export * from "./commands/ListRolePoliciesCommand"; +export * from "./pagination/ListRolePoliciesPaginator"; export * from "./commands/ListRolesCommand"; +export * from "./pagination/ListRolesPaginator"; export * from "./commands/ListRoleTagsCommand"; export * from "./commands/ListSAMLProvidersCommand"; export * from "./commands/ListServerCertificatesCommand"; +export * from "./pagination/ListServerCertificatesPaginator"; export * from "./commands/ListServiceSpecificCredentialsCommand"; export * from "./commands/ListSigningCertificatesCommand"; +export * from "./pagination/ListSigningCertificatesPaginator"; export * from "./commands/ListSSHPublicKeysCommand"; +export * from "./pagination/ListSSHPublicKeysPaginator"; export * from "./commands/ListUserPoliciesCommand"; +export * from "./pagination/ListUserPoliciesPaginator"; export * from "./commands/ListUsersCommand"; +export * from "./pagination/ListUsersPaginator"; export * from "./commands/ListUserTagsCommand"; export * from "./commands/ListVirtualMFADevicesCommand"; +export * from "./pagination/ListVirtualMFADevicesPaginator"; export * from "./commands/PutGroupPolicyCommand"; export * from "./commands/PutRolePermissionsBoundaryCommand"; export * from "./commands/PutRolePolicyCommand"; @@ -118,7 +142,9 @@ export * from "./commands/ResyncMFADeviceCommand"; export * from "./commands/SetDefaultPolicyVersionCommand"; export * from "./commands/SetSecurityTokenServicePreferencesCommand"; export * from "./commands/SimulateCustomPolicyCommand"; +export * from "./pagination/SimulateCustomPolicyPaginator"; export * from "./commands/SimulatePrincipalPolicyCommand"; +export * from "./pagination/SimulatePrincipalPolicyPaginator"; export * from "./commands/TagRoleCommand"; export * from "./commands/TagUserCommand"; export * from "./commands/UntagRoleCommand"; @@ -140,4 +166,5 @@ export * from "./commands/UpdateUserCommand"; export * from "./commands/UploadServerCertificateCommand"; export * from "./commands/UploadSigningCertificateCommand"; export * from "./commands/UploadSSHPublicKeyCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-iam/pagination/GetAccountAuthorizationDetailsPaginator.ts b/clients/client-iam/pagination/GetAccountAuthorizationDetailsPaginator.ts new file mode 100644 index 0000000000000..88cbc494c92be --- /dev/null +++ b/clients/client-iam/pagination/GetAccountAuthorizationDetailsPaginator.ts @@ -0,0 +1,51 @@ +import { IAM } from "../IAM"; +import { IAMClient } from "../IAMClient"; +import { + GetAccountAuthorizationDetailsCommand, + GetAccountAuthorizationDetailsCommandInput, + GetAccountAuthorizationDetailsCommandOutput, +} from "../commands/GetAccountAuthorizationDetailsCommand"; +import { IAMPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IAMClient, + input: GetAccountAuthorizationDetailsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetAccountAuthorizationDetailsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IAM, + input: GetAccountAuthorizationDetailsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getAccountAuthorizationDetails(input, ...args); +}; +export async function* getAccountAuthorizationDetailsPaginate( + config: IAMPaginationConfiguration, + input: GetAccountAuthorizationDetailsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetAccountAuthorizationDetailsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxItems"] = config.pageSize; + if (config.client instanceof IAM) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IAMClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IAM | IAMClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iam/pagination/GetGroupPaginator.ts b/clients/client-iam/pagination/GetGroupPaginator.ts new file mode 100644 index 0000000000000..ac691444d8ba0 --- /dev/null +++ b/clients/client-iam/pagination/GetGroupPaginator.ts @@ -0,0 +1,47 @@ +import { IAM } from "../IAM"; +import { IAMClient } from "../IAMClient"; +import { GetGroupCommand, GetGroupCommandInput, GetGroupCommandOutput } from "../commands/GetGroupCommand"; +import { IAMPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IAMClient, + input: GetGroupCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetGroupCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IAM, + input: GetGroupCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getGroup(input, ...args); +}; +export async function* getGroupPaginate( + config: IAMPaginationConfiguration, + input: GetGroupCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetGroupCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxItems"] = config.pageSize; + if (config.client instanceof IAM) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IAMClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IAM | IAMClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iam/pagination/Interfaces.ts b/clients/client-iam/pagination/Interfaces.ts new file mode 100644 index 0000000000000..811388904eae0 --- /dev/null +++ b/clients/client-iam/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { IAM } from "../IAM"; +import { IAMClient } from "../IAMClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface IAMPaginationConfiguration extends PaginationConfiguration { + client: IAM | IAMClient; +} diff --git a/clients/client-iam/pagination/ListAccessKeysPaginator.ts b/clients/client-iam/pagination/ListAccessKeysPaginator.ts new file mode 100644 index 0000000000000..c277d2c47914a --- /dev/null +++ b/clients/client-iam/pagination/ListAccessKeysPaginator.ts @@ -0,0 +1,51 @@ +import { IAM } from "../IAM"; +import { IAMClient } from "../IAMClient"; +import { + ListAccessKeysCommand, + ListAccessKeysCommandInput, + ListAccessKeysCommandOutput, +} from "../commands/ListAccessKeysCommand"; +import { IAMPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IAMClient, + input: ListAccessKeysCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListAccessKeysCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IAM, + input: ListAccessKeysCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listAccessKeys(input, ...args); +}; +export async function* listAccessKeysPaginate( + config: IAMPaginationConfiguration, + input: ListAccessKeysCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListAccessKeysCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxItems"] = config.pageSize; + if (config.client instanceof IAM) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IAMClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IAM | IAMClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iam/pagination/ListAccountAliasesPaginator.ts b/clients/client-iam/pagination/ListAccountAliasesPaginator.ts new file mode 100644 index 0000000000000..ff8dc35361a4c --- /dev/null +++ b/clients/client-iam/pagination/ListAccountAliasesPaginator.ts @@ -0,0 +1,51 @@ +import { IAM } from "../IAM"; +import { IAMClient } from "../IAMClient"; +import { + ListAccountAliasesCommand, + ListAccountAliasesCommandInput, + ListAccountAliasesCommandOutput, +} from "../commands/ListAccountAliasesCommand"; +import { IAMPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IAMClient, + input: ListAccountAliasesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListAccountAliasesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IAM, + input: ListAccountAliasesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listAccountAliases(input, ...args); +}; +export async function* listAccountAliasesPaginate( + config: IAMPaginationConfiguration, + input: ListAccountAliasesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListAccountAliasesCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxItems"] = config.pageSize; + if (config.client instanceof IAM) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IAMClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IAM | IAMClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iam/pagination/ListAttachedGroupPoliciesPaginator.ts b/clients/client-iam/pagination/ListAttachedGroupPoliciesPaginator.ts new file mode 100644 index 0000000000000..fa27a05164bd3 --- /dev/null +++ b/clients/client-iam/pagination/ListAttachedGroupPoliciesPaginator.ts @@ -0,0 +1,51 @@ +import { IAM } from "../IAM"; +import { IAMClient } from "../IAMClient"; +import { + ListAttachedGroupPoliciesCommand, + ListAttachedGroupPoliciesCommandInput, + ListAttachedGroupPoliciesCommandOutput, +} from "../commands/ListAttachedGroupPoliciesCommand"; +import { IAMPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IAMClient, + input: ListAttachedGroupPoliciesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListAttachedGroupPoliciesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IAM, + input: ListAttachedGroupPoliciesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listAttachedGroupPolicies(input, ...args); +}; +export async function* listAttachedGroupPoliciesPaginate( + config: IAMPaginationConfiguration, + input: ListAttachedGroupPoliciesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListAttachedGroupPoliciesCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxItems"] = config.pageSize; + if (config.client instanceof IAM) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IAMClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IAM | IAMClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iam/pagination/ListAttachedRolePoliciesPaginator.ts b/clients/client-iam/pagination/ListAttachedRolePoliciesPaginator.ts new file mode 100644 index 0000000000000..925d80e316ad5 --- /dev/null +++ b/clients/client-iam/pagination/ListAttachedRolePoliciesPaginator.ts @@ -0,0 +1,51 @@ +import { IAM } from "../IAM"; +import { IAMClient } from "../IAMClient"; +import { + ListAttachedRolePoliciesCommand, + ListAttachedRolePoliciesCommandInput, + ListAttachedRolePoliciesCommandOutput, +} from "../commands/ListAttachedRolePoliciesCommand"; +import { IAMPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IAMClient, + input: ListAttachedRolePoliciesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListAttachedRolePoliciesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IAM, + input: ListAttachedRolePoliciesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listAttachedRolePolicies(input, ...args); +}; +export async function* listAttachedRolePoliciesPaginate( + config: IAMPaginationConfiguration, + input: ListAttachedRolePoliciesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListAttachedRolePoliciesCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxItems"] = config.pageSize; + if (config.client instanceof IAM) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IAMClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IAM | IAMClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iam/pagination/ListAttachedUserPoliciesPaginator.ts b/clients/client-iam/pagination/ListAttachedUserPoliciesPaginator.ts new file mode 100644 index 0000000000000..8a2f75093ccb5 --- /dev/null +++ b/clients/client-iam/pagination/ListAttachedUserPoliciesPaginator.ts @@ -0,0 +1,51 @@ +import { IAM } from "../IAM"; +import { IAMClient } from "../IAMClient"; +import { + ListAttachedUserPoliciesCommand, + ListAttachedUserPoliciesCommandInput, + ListAttachedUserPoliciesCommandOutput, +} from "../commands/ListAttachedUserPoliciesCommand"; +import { IAMPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IAMClient, + input: ListAttachedUserPoliciesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListAttachedUserPoliciesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IAM, + input: ListAttachedUserPoliciesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listAttachedUserPolicies(input, ...args); +}; +export async function* listAttachedUserPoliciesPaginate( + config: IAMPaginationConfiguration, + input: ListAttachedUserPoliciesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListAttachedUserPoliciesCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxItems"] = config.pageSize; + if (config.client instanceof IAM) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IAMClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IAM | IAMClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iam/pagination/ListEntitiesForPolicyPaginator.ts b/clients/client-iam/pagination/ListEntitiesForPolicyPaginator.ts new file mode 100644 index 0000000000000..5c4f8ffc80b0b --- /dev/null +++ b/clients/client-iam/pagination/ListEntitiesForPolicyPaginator.ts @@ -0,0 +1,51 @@ +import { IAM } from "../IAM"; +import { IAMClient } from "../IAMClient"; +import { + ListEntitiesForPolicyCommand, + ListEntitiesForPolicyCommandInput, + ListEntitiesForPolicyCommandOutput, +} from "../commands/ListEntitiesForPolicyCommand"; +import { IAMPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IAMClient, + input: ListEntitiesForPolicyCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListEntitiesForPolicyCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IAM, + input: ListEntitiesForPolicyCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listEntitiesForPolicy(input, ...args); +}; +export async function* listEntitiesForPolicyPaginate( + config: IAMPaginationConfiguration, + input: ListEntitiesForPolicyCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListEntitiesForPolicyCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxItems"] = config.pageSize; + if (config.client instanceof IAM) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IAMClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IAM | IAMClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iam/pagination/ListGroupPoliciesPaginator.ts b/clients/client-iam/pagination/ListGroupPoliciesPaginator.ts new file mode 100644 index 0000000000000..178b88f0d7a93 --- /dev/null +++ b/clients/client-iam/pagination/ListGroupPoliciesPaginator.ts @@ -0,0 +1,51 @@ +import { IAM } from "../IAM"; +import { IAMClient } from "../IAMClient"; +import { + ListGroupPoliciesCommand, + ListGroupPoliciesCommandInput, + ListGroupPoliciesCommandOutput, +} from "../commands/ListGroupPoliciesCommand"; +import { IAMPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IAMClient, + input: ListGroupPoliciesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListGroupPoliciesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IAM, + input: ListGroupPoliciesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listGroupPolicies(input, ...args); +}; +export async function* listGroupPoliciesPaginate( + config: IAMPaginationConfiguration, + input: ListGroupPoliciesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListGroupPoliciesCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxItems"] = config.pageSize; + if (config.client instanceof IAM) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IAMClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IAM | IAMClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iam/pagination/ListGroupsForUserPaginator.ts b/clients/client-iam/pagination/ListGroupsForUserPaginator.ts new file mode 100644 index 0000000000000..7a3f5221b9a87 --- /dev/null +++ b/clients/client-iam/pagination/ListGroupsForUserPaginator.ts @@ -0,0 +1,51 @@ +import { IAM } from "../IAM"; +import { IAMClient } from "../IAMClient"; +import { + ListGroupsForUserCommand, + ListGroupsForUserCommandInput, + ListGroupsForUserCommandOutput, +} from "../commands/ListGroupsForUserCommand"; +import { IAMPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IAMClient, + input: ListGroupsForUserCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListGroupsForUserCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IAM, + input: ListGroupsForUserCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listGroupsForUser(input, ...args); +}; +export async function* listGroupsForUserPaginate( + config: IAMPaginationConfiguration, + input: ListGroupsForUserCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListGroupsForUserCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxItems"] = config.pageSize; + if (config.client instanceof IAM) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IAMClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IAM | IAMClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iam/pagination/ListGroupsPaginator.ts b/clients/client-iam/pagination/ListGroupsPaginator.ts new file mode 100644 index 0000000000000..5bae489b26640 --- /dev/null +++ b/clients/client-iam/pagination/ListGroupsPaginator.ts @@ -0,0 +1,47 @@ +import { IAM } from "../IAM"; +import { IAMClient } from "../IAMClient"; +import { ListGroupsCommand, ListGroupsCommandInput, ListGroupsCommandOutput } from "../commands/ListGroupsCommand"; +import { IAMPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IAMClient, + input: ListGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListGroupsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IAM, + input: ListGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listGroups(input, ...args); +}; +export async function* listGroupsPaginate( + config: IAMPaginationConfiguration, + input: ListGroupsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListGroupsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxItems"] = config.pageSize; + if (config.client instanceof IAM) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IAMClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IAM | IAMClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iam/pagination/ListInstanceProfilesForRolePaginator.ts b/clients/client-iam/pagination/ListInstanceProfilesForRolePaginator.ts new file mode 100644 index 0000000000000..4da75f6dc8fe2 --- /dev/null +++ b/clients/client-iam/pagination/ListInstanceProfilesForRolePaginator.ts @@ -0,0 +1,51 @@ +import { IAM } from "../IAM"; +import { IAMClient } from "../IAMClient"; +import { + ListInstanceProfilesForRoleCommand, + ListInstanceProfilesForRoleCommandInput, + ListInstanceProfilesForRoleCommandOutput, +} from "../commands/ListInstanceProfilesForRoleCommand"; +import { IAMPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IAMClient, + input: ListInstanceProfilesForRoleCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListInstanceProfilesForRoleCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IAM, + input: ListInstanceProfilesForRoleCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listInstanceProfilesForRole(input, ...args); +}; +export async function* listInstanceProfilesForRolePaginate( + config: IAMPaginationConfiguration, + input: ListInstanceProfilesForRoleCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListInstanceProfilesForRoleCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxItems"] = config.pageSize; + if (config.client instanceof IAM) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IAMClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IAM | IAMClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iam/pagination/ListInstanceProfilesPaginator.ts b/clients/client-iam/pagination/ListInstanceProfilesPaginator.ts new file mode 100644 index 0000000000000..fc85a532effaf --- /dev/null +++ b/clients/client-iam/pagination/ListInstanceProfilesPaginator.ts @@ -0,0 +1,51 @@ +import { IAM } from "../IAM"; +import { IAMClient } from "../IAMClient"; +import { + ListInstanceProfilesCommand, + ListInstanceProfilesCommandInput, + ListInstanceProfilesCommandOutput, +} from "../commands/ListInstanceProfilesCommand"; +import { IAMPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IAMClient, + input: ListInstanceProfilesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListInstanceProfilesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IAM, + input: ListInstanceProfilesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listInstanceProfiles(input, ...args); +}; +export async function* listInstanceProfilesPaginate( + config: IAMPaginationConfiguration, + input: ListInstanceProfilesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListInstanceProfilesCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxItems"] = config.pageSize; + if (config.client instanceof IAM) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IAMClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IAM | IAMClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iam/pagination/ListMFADevicesPaginator.ts b/clients/client-iam/pagination/ListMFADevicesPaginator.ts new file mode 100644 index 0000000000000..c89d69769eb85 --- /dev/null +++ b/clients/client-iam/pagination/ListMFADevicesPaginator.ts @@ -0,0 +1,51 @@ +import { IAM } from "../IAM"; +import { IAMClient } from "../IAMClient"; +import { + ListMFADevicesCommand, + ListMFADevicesCommandInput, + ListMFADevicesCommandOutput, +} from "../commands/ListMFADevicesCommand"; +import { IAMPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IAMClient, + input: ListMFADevicesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListMFADevicesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IAM, + input: ListMFADevicesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listMFADevices(input, ...args); +}; +export async function* listMFADevicesPaginate( + config: IAMPaginationConfiguration, + input: ListMFADevicesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListMFADevicesCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxItems"] = config.pageSize; + if (config.client instanceof IAM) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IAMClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IAM | IAMClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iam/pagination/ListPoliciesPaginator.ts b/clients/client-iam/pagination/ListPoliciesPaginator.ts new file mode 100644 index 0000000000000..c54e08a8bdc87 --- /dev/null +++ b/clients/client-iam/pagination/ListPoliciesPaginator.ts @@ -0,0 +1,51 @@ +import { IAM } from "../IAM"; +import { IAMClient } from "../IAMClient"; +import { + ListPoliciesCommand, + ListPoliciesCommandInput, + ListPoliciesCommandOutput, +} from "../commands/ListPoliciesCommand"; +import { IAMPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IAMClient, + input: ListPoliciesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListPoliciesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IAM, + input: ListPoliciesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listPolicies(input, ...args); +}; +export async function* listPoliciesPaginate( + config: IAMPaginationConfiguration, + input: ListPoliciesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListPoliciesCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxItems"] = config.pageSize; + if (config.client instanceof IAM) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IAMClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IAM | IAMClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iam/pagination/ListPolicyVersionsPaginator.ts b/clients/client-iam/pagination/ListPolicyVersionsPaginator.ts new file mode 100644 index 0000000000000..b385d5fa3139b --- /dev/null +++ b/clients/client-iam/pagination/ListPolicyVersionsPaginator.ts @@ -0,0 +1,51 @@ +import { IAM } from "../IAM"; +import { IAMClient } from "../IAMClient"; +import { + ListPolicyVersionsCommand, + ListPolicyVersionsCommandInput, + ListPolicyVersionsCommandOutput, +} from "../commands/ListPolicyVersionsCommand"; +import { IAMPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IAMClient, + input: ListPolicyVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListPolicyVersionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IAM, + input: ListPolicyVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listPolicyVersions(input, ...args); +}; +export async function* listPolicyVersionsPaginate( + config: IAMPaginationConfiguration, + input: ListPolicyVersionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListPolicyVersionsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxItems"] = config.pageSize; + if (config.client instanceof IAM) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IAMClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IAM | IAMClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iam/pagination/ListRolePoliciesPaginator.ts b/clients/client-iam/pagination/ListRolePoliciesPaginator.ts new file mode 100644 index 0000000000000..3c48a706b77db --- /dev/null +++ b/clients/client-iam/pagination/ListRolePoliciesPaginator.ts @@ -0,0 +1,51 @@ +import { IAM } from "../IAM"; +import { IAMClient } from "../IAMClient"; +import { + ListRolePoliciesCommand, + ListRolePoliciesCommandInput, + ListRolePoliciesCommandOutput, +} from "../commands/ListRolePoliciesCommand"; +import { IAMPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IAMClient, + input: ListRolePoliciesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListRolePoliciesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IAM, + input: ListRolePoliciesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listRolePolicies(input, ...args); +}; +export async function* listRolePoliciesPaginate( + config: IAMPaginationConfiguration, + input: ListRolePoliciesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListRolePoliciesCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxItems"] = config.pageSize; + if (config.client instanceof IAM) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IAMClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IAM | IAMClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iam/pagination/ListRolesPaginator.ts b/clients/client-iam/pagination/ListRolesPaginator.ts new file mode 100644 index 0000000000000..7687e9ed9df9b --- /dev/null +++ b/clients/client-iam/pagination/ListRolesPaginator.ts @@ -0,0 +1,47 @@ +import { IAM } from "../IAM"; +import { IAMClient } from "../IAMClient"; +import { ListRolesCommand, ListRolesCommandInput, ListRolesCommandOutput } from "../commands/ListRolesCommand"; +import { IAMPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IAMClient, + input: ListRolesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListRolesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IAM, + input: ListRolesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listRoles(input, ...args); +}; +export async function* listRolesPaginate( + config: IAMPaginationConfiguration, + input: ListRolesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListRolesCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxItems"] = config.pageSize; + if (config.client instanceof IAM) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IAMClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IAM | IAMClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iam/pagination/ListSSHPublicKeysPaginator.ts b/clients/client-iam/pagination/ListSSHPublicKeysPaginator.ts new file mode 100644 index 0000000000000..809b5a6c4add5 --- /dev/null +++ b/clients/client-iam/pagination/ListSSHPublicKeysPaginator.ts @@ -0,0 +1,51 @@ +import { IAM } from "../IAM"; +import { IAMClient } from "../IAMClient"; +import { + ListSSHPublicKeysCommand, + ListSSHPublicKeysCommandInput, + ListSSHPublicKeysCommandOutput, +} from "../commands/ListSSHPublicKeysCommand"; +import { IAMPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IAMClient, + input: ListSSHPublicKeysCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListSSHPublicKeysCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IAM, + input: ListSSHPublicKeysCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listSSHPublicKeys(input, ...args); +}; +export async function* listSSHPublicKeysPaginate( + config: IAMPaginationConfiguration, + input: ListSSHPublicKeysCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListSSHPublicKeysCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxItems"] = config.pageSize; + if (config.client instanceof IAM) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IAMClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IAM | IAMClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iam/pagination/ListServerCertificatesPaginator.ts b/clients/client-iam/pagination/ListServerCertificatesPaginator.ts new file mode 100644 index 0000000000000..1f85a5de23a98 --- /dev/null +++ b/clients/client-iam/pagination/ListServerCertificatesPaginator.ts @@ -0,0 +1,51 @@ +import { IAM } from "../IAM"; +import { IAMClient } from "../IAMClient"; +import { + ListServerCertificatesCommand, + ListServerCertificatesCommandInput, + ListServerCertificatesCommandOutput, +} from "../commands/ListServerCertificatesCommand"; +import { IAMPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IAMClient, + input: ListServerCertificatesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListServerCertificatesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IAM, + input: ListServerCertificatesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listServerCertificates(input, ...args); +}; +export async function* listServerCertificatesPaginate( + config: IAMPaginationConfiguration, + input: ListServerCertificatesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListServerCertificatesCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxItems"] = config.pageSize; + if (config.client instanceof IAM) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IAMClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IAM | IAMClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iam/pagination/ListSigningCertificatesPaginator.ts b/clients/client-iam/pagination/ListSigningCertificatesPaginator.ts new file mode 100644 index 0000000000000..22a8a0d3540a5 --- /dev/null +++ b/clients/client-iam/pagination/ListSigningCertificatesPaginator.ts @@ -0,0 +1,51 @@ +import { IAM } from "../IAM"; +import { IAMClient } from "../IAMClient"; +import { + ListSigningCertificatesCommand, + ListSigningCertificatesCommandInput, + ListSigningCertificatesCommandOutput, +} from "../commands/ListSigningCertificatesCommand"; +import { IAMPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IAMClient, + input: ListSigningCertificatesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListSigningCertificatesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IAM, + input: ListSigningCertificatesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listSigningCertificates(input, ...args); +}; +export async function* listSigningCertificatesPaginate( + config: IAMPaginationConfiguration, + input: ListSigningCertificatesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListSigningCertificatesCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxItems"] = config.pageSize; + if (config.client instanceof IAM) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IAMClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IAM | IAMClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iam/pagination/ListUserPoliciesPaginator.ts b/clients/client-iam/pagination/ListUserPoliciesPaginator.ts new file mode 100644 index 0000000000000..84a5a2cc76168 --- /dev/null +++ b/clients/client-iam/pagination/ListUserPoliciesPaginator.ts @@ -0,0 +1,51 @@ +import { IAM } from "../IAM"; +import { IAMClient } from "../IAMClient"; +import { + ListUserPoliciesCommand, + ListUserPoliciesCommandInput, + ListUserPoliciesCommandOutput, +} from "../commands/ListUserPoliciesCommand"; +import { IAMPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IAMClient, + input: ListUserPoliciesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListUserPoliciesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IAM, + input: ListUserPoliciesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listUserPolicies(input, ...args); +}; +export async function* listUserPoliciesPaginate( + config: IAMPaginationConfiguration, + input: ListUserPoliciesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListUserPoliciesCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxItems"] = config.pageSize; + if (config.client instanceof IAM) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IAMClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IAM | IAMClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iam/pagination/ListUsersPaginator.ts b/clients/client-iam/pagination/ListUsersPaginator.ts new file mode 100644 index 0000000000000..333efc5075062 --- /dev/null +++ b/clients/client-iam/pagination/ListUsersPaginator.ts @@ -0,0 +1,47 @@ +import { IAM } from "../IAM"; +import { IAMClient } from "../IAMClient"; +import { ListUsersCommand, ListUsersCommandInput, ListUsersCommandOutput } from "../commands/ListUsersCommand"; +import { IAMPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IAMClient, + input: ListUsersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListUsersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IAM, + input: ListUsersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listUsers(input, ...args); +}; +export async function* listUsersPaginate( + config: IAMPaginationConfiguration, + input: ListUsersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListUsersCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxItems"] = config.pageSize; + if (config.client instanceof IAM) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IAMClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IAM | IAMClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iam/pagination/ListVirtualMFADevicesPaginator.ts b/clients/client-iam/pagination/ListVirtualMFADevicesPaginator.ts new file mode 100644 index 0000000000000..a65c2be1702c9 --- /dev/null +++ b/clients/client-iam/pagination/ListVirtualMFADevicesPaginator.ts @@ -0,0 +1,51 @@ +import { IAM } from "../IAM"; +import { IAMClient } from "../IAMClient"; +import { + ListVirtualMFADevicesCommand, + ListVirtualMFADevicesCommandInput, + ListVirtualMFADevicesCommandOutput, +} from "../commands/ListVirtualMFADevicesCommand"; +import { IAMPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IAMClient, + input: ListVirtualMFADevicesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListVirtualMFADevicesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IAM, + input: ListVirtualMFADevicesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listVirtualMFADevices(input, ...args); +}; +export async function* listVirtualMFADevicesPaginate( + config: IAMPaginationConfiguration, + input: ListVirtualMFADevicesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListVirtualMFADevicesCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxItems"] = config.pageSize; + if (config.client instanceof IAM) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IAMClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IAM | IAMClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iam/pagination/SimulateCustomPolicyPaginator.ts b/clients/client-iam/pagination/SimulateCustomPolicyPaginator.ts new file mode 100644 index 0000000000000..9b1c0ea0a59bf --- /dev/null +++ b/clients/client-iam/pagination/SimulateCustomPolicyPaginator.ts @@ -0,0 +1,51 @@ +import { IAM } from "../IAM"; +import { IAMClient } from "../IAMClient"; +import { + SimulateCustomPolicyCommand, + SimulateCustomPolicyCommandInput, + SimulateCustomPolicyCommandOutput, +} from "../commands/SimulateCustomPolicyCommand"; +import { IAMPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IAMClient, + input: SimulateCustomPolicyCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new SimulateCustomPolicyCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IAM, + input: SimulateCustomPolicyCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.simulateCustomPolicy(input, ...args); +}; +export async function* simulateCustomPolicyPaginate( + config: IAMPaginationConfiguration, + input: SimulateCustomPolicyCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: SimulateCustomPolicyCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxItems"] = config.pageSize; + if (config.client instanceof IAM) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IAMClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IAM | IAMClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iam/pagination/SimulatePrincipalPolicyPaginator.ts b/clients/client-iam/pagination/SimulatePrincipalPolicyPaginator.ts new file mode 100644 index 0000000000000..42dec076cea66 --- /dev/null +++ b/clients/client-iam/pagination/SimulatePrincipalPolicyPaginator.ts @@ -0,0 +1,51 @@ +import { IAM } from "../IAM"; +import { IAMClient } from "../IAMClient"; +import { + SimulatePrincipalPolicyCommand, + SimulatePrincipalPolicyCommandInput, + SimulatePrincipalPolicyCommandOutput, +} from "../commands/SimulatePrincipalPolicyCommand"; +import { IAMPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IAMClient, + input: SimulatePrincipalPolicyCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new SimulatePrincipalPolicyCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IAM, + input: SimulatePrincipalPolicyCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.simulatePrincipalPolicy(input, ...args); +}; +export async function* simulatePrincipalPolicyPaginate( + config: IAMPaginationConfiguration, + input: SimulatePrincipalPolicyCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: SimulatePrincipalPolicyCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxItems"] = config.pageSize; + if (config.client instanceof IAM) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IAMClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IAM | IAMClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-inspector/index.ts b/clients/client-inspector/index.ts index 42a4ca2ece413..c87dc37385eef 100644 --- a/clients/client-inspector/index.ts +++ b/clients/client-inspector/index.ts @@ -18,17 +18,27 @@ export * from "./commands/DescribeResourceGroupsCommand"; export * from "./commands/DescribeRulesPackagesCommand"; export * from "./commands/GetAssessmentReportCommand"; export * from "./commands/GetExclusionsPreviewCommand"; +export * from "./pagination/GetExclusionsPreviewPaginator"; export * from "./commands/GetTelemetryMetadataCommand"; export * from "./commands/ListAssessmentRunAgentsCommand"; +export * from "./pagination/ListAssessmentRunAgentsPaginator"; export * from "./commands/ListAssessmentRunsCommand"; +export * from "./pagination/ListAssessmentRunsPaginator"; export * from "./commands/ListAssessmentTargetsCommand"; +export * from "./pagination/ListAssessmentTargetsPaginator"; export * from "./commands/ListAssessmentTemplatesCommand"; +export * from "./pagination/ListAssessmentTemplatesPaginator"; export * from "./commands/ListEventSubscriptionsCommand"; +export * from "./pagination/ListEventSubscriptionsPaginator"; export * from "./commands/ListExclusionsCommand"; +export * from "./pagination/ListExclusionsPaginator"; export * from "./commands/ListFindingsCommand"; +export * from "./pagination/ListFindingsPaginator"; export * from "./commands/ListRulesPackagesCommand"; +export * from "./pagination/ListRulesPackagesPaginator"; export * from "./commands/ListTagsForResourceCommand"; export * from "./commands/PreviewAgentsCommand"; +export * from "./pagination/PreviewAgentsPaginator"; export * from "./commands/RegisterCrossAccountAccessRoleCommand"; export * from "./commands/RemoveAttributesFromFindingsCommand"; export * from "./commands/SetTagsForResourceCommand"; @@ -37,4 +47,5 @@ export * from "./commands/StopAssessmentRunCommand"; export * from "./commands/SubscribeToEventCommand"; export * from "./commands/UnsubscribeFromEventCommand"; export * from "./commands/UpdateAssessmentTargetCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-inspector/pagination/GetExclusionsPreviewPaginator.ts b/clients/client-inspector/pagination/GetExclusionsPreviewPaginator.ts new file mode 100644 index 0000000000000..975d40fa6ed61 --- /dev/null +++ b/clients/client-inspector/pagination/GetExclusionsPreviewPaginator.ts @@ -0,0 +1,51 @@ +import { Inspector } from "../Inspector"; +import { InspectorClient } from "../InspectorClient"; +import { + GetExclusionsPreviewCommand, + GetExclusionsPreviewCommandInput, + GetExclusionsPreviewCommandOutput, +} from "../commands/GetExclusionsPreviewCommand"; +import { InspectorPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: InspectorClient, + input: GetExclusionsPreviewCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetExclusionsPreviewCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Inspector, + input: GetExclusionsPreviewCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getExclusionsPreview(input, ...args); +}; +export async function* getExclusionsPreviewPaginate( + config: InspectorPaginationConfiguration, + input: GetExclusionsPreviewCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetExclusionsPreviewCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof Inspector) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof InspectorClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Inspector | InspectorClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-inspector/pagination/Interfaces.ts b/clients/client-inspector/pagination/Interfaces.ts new file mode 100644 index 0000000000000..8e17bf133c626 --- /dev/null +++ b/clients/client-inspector/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { Inspector } from "../Inspector"; +import { InspectorClient } from "../InspectorClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface InspectorPaginationConfiguration extends PaginationConfiguration { + client: Inspector | InspectorClient; +} diff --git a/clients/client-inspector/pagination/ListAssessmentRunAgentsPaginator.ts b/clients/client-inspector/pagination/ListAssessmentRunAgentsPaginator.ts new file mode 100644 index 0000000000000..9e6d1d5b8abb4 --- /dev/null +++ b/clients/client-inspector/pagination/ListAssessmentRunAgentsPaginator.ts @@ -0,0 +1,51 @@ +import { Inspector } from "../Inspector"; +import { InspectorClient } from "../InspectorClient"; +import { + ListAssessmentRunAgentsCommand, + ListAssessmentRunAgentsCommandInput, + ListAssessmentRunAgentsCommandOutput, +} from "../commands/ListAssessmentRunAgentsCommand"; +import { InspectorPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: InspectorClient, + input: ListAssessmentRunAgentsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListAssessmentRunAgentsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Inspector, + input: ListAssessmentRunAgentsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listAssessmentRunAgents(input, ...args); +}; +export async function* listAssessmentRunAgentsPaginate( + config: InspectorPaginationConfiguration, + input: ListAssessmentRunAgentsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListAssessmentRunAgentsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof Inspector) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof InspectorClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Inspector | InspectorClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-inspector/pagination/ListAssessmentRunsPaginator.ts b/clients/client-inspector/pagination/ListAssessmentRunsPaginator.ts new file mode 100644 index 0000000000000..d074e4cabc49e --- /dev/null +++ b/clients/client-inspector/pagination/ListAssessmentRunsPaginator.ts @@ -0,0 +1,51 @@ +import { Inspector } from "../Inspector"; +import { InspectorClient } from "../InspectorClient"; +import { + ListAssessmentRunsCommand, + ListAssessmentRunsCommandInput, + ListAssessmentRunsCommandOutput, +} from "../commands/ListAssessmentRunsCommand"; +import { InspectorPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: InspectorClient, + input: ListAssessmentRunsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListAssessmentRunsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Inspector, + input: ListAssessmentRunsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listAssessmentRuns(input, ...args); +}; +export async function* listAssessmentRunsPaginate( + config: InspectorPaginationConfiguration, + input: ListAssessmentRunsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListAssessmentRunsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof Inspector) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof InspectorClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Inspector | InspectorClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-inspector/pagination/ListAssessmentTargetsPaginator.ts b/clients/client-inspector/pagination/ListAssessmentTargetsPaginator.ts new file mode 100644 index 0000000000000..6c8c4477aa4bc --- /dev/null +++ b/clients/client-inspector/pagination/ListAssessmentTargetsPaginator.ts @@ -0,0 +1,51 @@ +import { Inspector } from "../Inspector"; +import { InspectorClient } from "../InspectorClient"; +import { + ListAssessmentTargetsCommand, + ListAssessmentTargetsCommandInput, + ListAssessmentTargetsCommandOutput, +} from "../commands/ListAssessmentTargetsCommand"; +import { InspectorPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: InspectorClient, + input: ListAssessmentTargetsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListAssessmentTargetsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Inspector, + input: ListAssessmentTargetsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listAssessmentTargets(input, ...args); +}; +export async function* listAssessmentTargetsPaginate( + config: InspectorPaginationConfiguration, + input: ListAssessmentTargetsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListAssessmentTargetsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof Inspector) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof InspectorClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Inspector | InspectorClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-inspector/pagination/ListAssessmentTemplatesPaginator.ts b/clients/client-inspector/pagination/ListAssessmentTemplatesPaginator.ts new file mode 100644 index 0000000000000..513d49c316c4b --- /dev/null +++ b/clients/client-inspector/pagination/ListAssessmentTemplatesPaginator.ts @@ -0,0 +1,51 @@ +import { Inspector } from "../Inspector"; +import { InspectorClient } from "../InspectorClient"; +import { + ListAssessmentTemplatesCommand, + ListAssessmentTemplatesCommandInput, + ListAssessmentTemplatesCommandOutput, +} from "../commands/ListAssessmentTemplatesCommand"; +import { InspectorPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: InspectorClient, + input: ListAssessmentTemplatesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListAssessmentTemplatesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Inspector, + input: ListAssessmentTemplatesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listAssessmentTemplates(input, ...args); +}; +export async function* listAssessmentTemplatesPaginate( + config: InspectorPaginationConfiguration, + input: ListAssessmentTemplatesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListAssessmentTemplatesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof Inspector) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof InspectorClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Inspector | InspectorClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-inspector/pagination/ListEventSubscriptionsPaginator.ts b/clients/client-inspector/pagination/ListEventSubscriptionsPaginator.ts new file mode 100644 index 0000000000000..79148eb771f04 --- /dev/null +++ b/clients/client-inspector/pagination/ListEventSubscriptionsPaginator.ts @@ -0,0 +1,51 @@ +import { Inspector } from "../Inspector"; +import { InspectorClient } from "../InspectorClient"; +import { + ListEventSubscriptionsCommand, + ListEventSubscriptionsCommandInput, + ListEventSubscriptionsCommandOutput, +} from "../commands/ListEventSubscriptionsCommand"; +import { InspectorPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: InspectorClient, + input: ListEventSubscriptionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListEventSubscriptionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Inspector, + input: ListEventSubscriptionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listEventSubscriptions(input, ...args); +}; +export async function* listEventSubscriptionsPaginate( + config: InspectorPaginationConfiguration, + input: ListEventSubscriptionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListEventSubscriptionsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof Inspector) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof InspectorClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Inspector | InspectorClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-inspector/pagination/ListExclusionsPaginator.ts b/clients/client-inspector/pagination/ListExclusionsPaginator.ts new file mode 100644 index 0000000000000..e910aa1b2b729 --- /dev/null +++ b/clients/client-inspector/pagination/ListExclusionsPaginator.ts @@ -0,0 +1,51 @@ +import { Inspector } from "../Inspector"; +import { InspectorClient } from "../InspectorClient"; +import { + ListExclusionsCommand, + ListExclusionsCommandInput, + ListExclusionsCommandOutput, +} from "../commands/ListExclusionsCommand"; +import { InspectorPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: InspectorClient, + input: ListExclusionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListExclusionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Inspector, + input: ListExclusionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listExclusions(input, ...args); +}; +export async function* listExclusionsPaginate( + config: InspectorPaginationConfiguration, + input: ListExclusionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListExclusionsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof Inspector) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof InspectorClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Inspector | InspectorClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-inspector/pagination/ListFindingsPaginator.ts b/clients/client-inspector/pagination/ListFindingsPaginator.ts new file mode 100644 index 0000000000000..ae227c6b7a204 --- /dev/null +++ b/clients/client-inspector/pagination/ListFindingsPaginator.ts @@ -0,0 +1,51 @@ +import { Inspector } from "../Inspector"; +import { InspectorClient } from "../InspectorClient"; +import { + ListFindingsCommand, + ListFindingsCommandInput, + ListFindingsCommandOutput, +} from "../commands/ListFindingsCommand"; +import { InspectorPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: InspectorClient, + input: ListFindingsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListFindingsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Inspector, + input: ListFindingsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listFindings(input, ...args); +}; +export async function* listFindingsPaginate( + config: InspectorPaginationConfiguration, + input: ListFindingsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListFindingsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof Inspector) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof InspectorClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Inspector | InspectorClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-inspector/pagination/ListRulesPackagesPaginator.ts b/clients/client-inspector/pagination/ListRulesPackagesPaginator.ts new file mode 100644 index 0000000000000..f1d9d5b078510 --- /dev/null +++ b/clients/client-inspector/pagination/ListRulesPackagesPaginator.ts @@ -0,0 +1,51 @@ +import { Inspector } from "../Inspector"; +import { InspectorClient } from "../InspectorClient"; +import { + ListRulesPackagesCommand, + ListRulesPackagesCommandInput, + ListRulesPackagesCommandOutput, +} from "../commands/ListRulesPackagesCommand"; +import { InspectorPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: InspectorClient, + input: ListRulesPackagesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListRulesPackagesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Inspector, + input: ListRulesPackagesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listRulesPackages(input, ...args); +}; +export async function* listRulesPackagesPaginate( + config: InspectorPaginationConfiguration, + input: ListRulesPackagesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListRulesPackagesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof Inspector) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof InspectorClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Inspector | InspectorClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-inspector/pagination/PreviewAgentsPaginator.ts b/clients/client-inspector/pagination/PreviewAgentsPaginator.ts new file mode 100644 index 0000000000000..66828591bbc1c --- /dev/null +++ b/clients/client-inspector/pagination/PreviewAgentsPaginator.ts @@ -0,0 +1,51 @@ +import { Inspector } from "../Inspector"; +import { InspectorClient } from "../InspectorClient"; +import { + PreviewAgentsCommand, + PreviewAgentsCommandInput, + PreviewAgentsCommandOutput, +} from "../commands/PreviewAgentsCommand"; +import { InspectorPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: InspectorClient, + input: PreviewAgentsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new PreviewAgentsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Inspector, + input: PreviewAgentsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.previewAgents(input, ...args); +}; +export async function* previewAgentsPaginate( + config: InspectorPaginationConfiguration, + input: PreviewAgentsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: PreviewAgentsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof Inspector) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof InspectorClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Inspector | InspectorClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iot-1click-projects/index.ts b/clients/client-iot-1click-projects/index.ts index 40ba6839a40e7..7fc50d89cfcea 100644 --- a/clients/client-iot-1click-projects/index.ts +++ b/clients/client-iot-1click-projects/index.ts @@ -10,10 +10,13 @@ export * from "./commands/DescribeProjectCommand"; export * from "./commands/DisassociateDeviceFromPlacementCommand"; export * from "./commands/GetDevicesInPlacementCommand"; export * from "./commands/ListPlacementsCommand"; +export * from "./pagination/ListPlacementsPaginator"; export * from "./commands/ListProjectsCommand"; +export * from "./pagination/ListProjectsPaginator"; export * from "./commands/ListTagsForResourceCommand"; export * from "./commands/TagResourceCommand"; export * from "./commands/UntagResourceCommand"; export * from "./commands/UpdatePlacementCommand"; export * from "./commands/UpdateProjectCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-iot-1click-projects/pagination/Interfaces.ts b/clients/client-iot-1click-projects/pagination/Interfaces.ts new file mode 100644 index 0000000000000..2f8a83ae56276 --- /dev/null +++ b/clients/client-iot-1click-projects/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { IoT1ClickProjects } from "../IoT1ClickProjects"; +import { IoT1ClickProjectsClient } from "../IoT1ClickProjectsClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface IoT1ClickProjectsPaginationConfiguration extends PaginationConfiguration { + client: IoT1ClickProjects | IoT1ClickProjectsClient; +} diff --git a/clients/client-iot-1click-projects/pagination/ListPlacementsPaginator.ts b/clients/client-iot-1click-projects/pagination/ListPlacementsPaginator.ts new file mode 100644 index 0000000000000..3a7f8076628ba --- /dev/null +++ b/clients/client-iot-1click-projects/pagination/ListPlacementsPaginator.ts @@ -0,0 +1,51 @@ +import { IoT1ClickProjects } from "../IoT1ClickProjects"; +import { IoT1ClickProjectsClient } from "../IoT1ClickProjectsClient"; +import { + ListPlacementsCommand, + ListPlacementsCommandInput, + ListPlacementsCommandOutput, +} from "../commands/ListPlacementsCommand"; +import { IoT1ClickProjectsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IoT1ClickProjectsClient, + input: ListPlacementsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListPlacementsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IoT1ClickProjects, + input: ListPlacementsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listPlacements(input, ...args); +}; +export async function* listPlacementsPaginate( + config: IoT1ClickProjectsPaginationConfiguration, + input: ListPlacementsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListPlacementsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof IoT1ClickProjects) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IoT1ClickProjectsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IoT1ClickProjects | IoT1ClickProjectsClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iot-1click-projects/pagination/ListProjectsPaginator.ts b/clients/client-iot-1click-projects/pagination/ListProjectsPaginator.ts new file mode 100644 index 0000000000000..cd09bcb130b8b --- /dev/null +++ b/clients/client-iot-1click-projects/pagination/ListProjectsPaginator.ts @@ -0,0 +1,51 @@ +import { IoT1ClickProjects } from "../IoT1ClickProjects"; +import { IoT1ClickProjectsClient } from "../IoT1ClickProjectsClient"; +import { + ListProjectsCommand, + ListProjectsCommandInput, + ListProjectsCommandOutput, +} from "../commands/ListProjectsCommand"; +import { IoT1ClickProjectsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IoT1ClickProjectsClient, + input: ListProjectsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListProjectsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IoT1ClickProjects, + input: ListProjectsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listProjects(input, ...args); +}; +export async function* listProjectsPaginate( + config: IoT1ClickProjectsPaginationConfiguration, + input: ListProjectsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListProjectsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof IoT1ClickProjects) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IoT1ClickProjectsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IoT1ClickProjects | IoT1ClickProjectsClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iotanalytics/index.ts b/clients/client-iotanalytics/index.ts index e080bda9bd9c8..2786594f751af 100644 --- a/clients/client-iotanalytics/index.ts +++ b/clients/client-iotanalytics/index.ts @@ -19,10 +19,15 @@ export * from "./commands/DescribeLoggingOptionsCommand"; export * from "./commands/DescribePipelineCommand"; export * from "./commands/GetDatasetContentCommand"; export * from "./commands/ListChannelsCommand"; +export * from "./pagination/ListChannelsPaginator"; export * from "./commands/ListDatasetContentsCommand"; +export * from "./pagination/ListDatasetContentsPaginator"; export * from "./commands/ListDatasetsCommand"; +export * from "./pagination/ListDatasetsPaginator"; export * from "./commands/ListDatastoresCommand"; +export * from "./pagination/ListDatastoresPaginator"; export * from "./commands/ListPipelinesCommand"; +export * from "./pagination/ListPipelinesPaginator"; export * from "./commands/ListTagsForResourceCommand"; export * from "./commands/PutLoggingOptionsCommand"; export * from "./commands/RunPipelineActivityCommand"; @@ -34,4 +39,5 @@ export * from "./commands/UpdateChannelCommand"; export * from "./commands/UpdateDatasetCommand"; export * from "./commands/UpdateDatastoreCommand"; export * from "./commands/UpdatePipelineCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-iotanalytics/pagination/Interfaces.ts b/clients/client-iotanalytics/pagination/Interfaces.ts new file mode 100644 index 0000000000000..59a5c6ef5b064 --- /dev/null +++ b/clients/client-iotanalytics/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { IoTAnalytics } from "../IoTAnalytics"; +import { IoTAnalyticsClient } from "../IoTAnalyticsClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface IoTAnalyticsPaginationConfiguration extends PaginationConfiguration { + client: IoTAnalytics | IoTAnalyticsClient; +} diff --git a/clients/client-iotanalytics/pagination/ListChannelsPaginator.ts b/clients/client-iotanalytics/pagination/ListChannelsPaginator.ts new file mode 100644 index 0000000000000..f7e180ae6cb93 --- /dev/null +++ b/clients/client-iotanalytics/pagination/ListChannelsPaginator.ts @@ -0,0 +1,51 @@ +import { IoTAnalytics } from "../IoTAnalytics"; +import { IoTAnalyticsClient } from "../IoTAnalyticsClient"; +import { + ListChannelsCommand, + ListChannelsCommandInput, + ListChannelsCommandOutput, +} from "../commands/ListChannelsCommand"; +import { IoTAnalyticsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IoTAnalyticsClient, + input: ListChannelsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListChannelsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IoTAnalytics, + input: ListChannelsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listChannels(input, ...args); +}; +export async function* listChannelsPaginate( + config: IoTAnalyticsPaginationConfiguration, + input: ListChannelsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListChannelsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof IoTAnalytics) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IoTAnalyticsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IoTAnalytics | IoTAnalyticsClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iotanalytics/pagination/ListDatasetContentsPaginator.ts b/clients/client-iotanalytics/pagination/ListDatasetContentsPaginator.ts new file mode 100644 index 0000000000000..ffd51d14c5d27 --- /dev/null +++ b/clients/client-iotanalytics/pagination/ListDatasetContentsPaginator.ts @@ -0,0 +1,51 @@ +import { IoTAnalytics } from "../IoTAnalytics"; +import { IoTAnalyticsClient } from "../IoTAnalyticsClient"; +import { + ListDatasetContentsCommand, + ListDatasetContentsCommandInput, + ListDatasetContentsCommandOutput, +} from "../commands/ListDatasetContentsCommand"; +import { IoTAnalyticsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IoTAnalyticsClient, + input: ListDatasetContentsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDatasetContentsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IoTAnalytics, + input: ListDatasetContentsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDatasetContents(input, ...args); +}; +export async function* listDatasetContentsPaginate( + config: IoTAnalyticsPaginationConfiguration, + input: ListDatasetContentsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDatasetContentsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof IoTAnalytics) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IoTAnalyticsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IoTAnalytics | IoTAnalyticsClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iotanalytics/pagination/ListDatasetsPaginator.ts b/clients/client-iotanalytics/pagination/ListDatasetsPaginator.ts new file mode 100644 index 0000000000000..01afdf9636dfe --- /dev/null +++ b/clients/client-iotanalytics/pagination/ListDatasetsPaginator.ts @@ -0,0 +1,51 @@ +import { IoTAnalytics } from "../IoTAnalytics"; +import { IoTAnalyticsClient } from "../IoTAnalyticsClient"; +import { + ListDatasetsCommand, + ListDatasetsCommandInput, + ListDatasetsCommandOutput, +} from "../commands/ListDatasetsCommand"; +import { IoTAnalyticsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IoTAnalyticsClient, + input: ListDatasetsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDatasetsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IoTAnalytics, + input: ListDatasetsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDatasets(input, ...args); +}; +export async function* listDatasetsPaginate( + config: IoTAnalyticsPaginationConfiguration, + input: ListDatasetsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDatasetsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof IoTAnalytics) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IoTAnalyticsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IoTAnalytics | IoTAnalyticsClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iotanalytics/pagination/ListDatastoresPaginator.ts b/clients/client-iotanalytics/pagination/ListDatastoresPaginator.ts new file mode 100644 index 0000000000000..429dd4c7fdf87 --- /dev/null +++ b/clients/client-iotanalytics/pagination/ListDatastoresPaginator.ts @@ -0,0 +1,51 @@ +import { IoTAnalytics } from "../IoTAnalytics"; +import { IoTAnalyticsClient } from "../IoTAnalyticsClient"; +import { + ListDatastoresCommand, + ListDatastoresCommandInput, + ListDatastoresCommandOutput, +} from "../commands/ListDatastoresCommand"; +import { IoTAnalyticsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IoTAnalyticsClient, + input: ListDatastoresCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDatastoresCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IoTAnalytics, + input: ListDatastoresCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDatastores(input, ...args); +}; +export async function* listDatastoresPaginate( + config: IoTAnalyticsPaginationConfiguration, + input: ListDatastoresCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDatastoresCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof IoTAnalytics) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IoTAnalyticsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IoTAnalytics | IoTAnalyticsClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iotanalytics/pagination/ListPipelinesPaginator.ts b/clients/client-iotanalytics/pagination/ListPipelinesPaginator.ts new file mode 100644 index 0000000000000..a37197c2b171e --- /dev/null +++ b/clients/client-iotanalytics/pagination/ListPipelinesPaginator.ts @@ -0,0 +1,51 @@ +import { IoTAnalytics } from "../IoTAnalytics"; +import { IoTAnalyticsClient } from "../IoTAnalyticsClient"; +import { + ListPipelinesCommand, + ListPipelinesCommandInput, + ListPipelinesCommandOutput, +} from "../commands/ListPipelinesCommand"; +import { IoTAnalyticsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IoTAnalyticsClient, + input: ListPipelinesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListPipelinesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IoTAnalytics, + input: ListPipelinesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listPipelines(input, ...args); +}; +export async function* listPipelinesPaginate( + config: IoTAnalyticsPaginationConfiguration, + input: ListPipelinesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListPipelinesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof IoTAnalytics) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IoTAnalyticsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IoTAnalytics | IoTAnalyticsClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iotsecuretunneling/index.ts b/clients/client-iotsecuretunneling/index.ts index 04a077c63e0e7..dd14718ae358d 100644 --- a/clients/client-iotsecuretunneling/index.ts +++ b/clients/client-iotsecuretunneling/index.ts @@ -4,7 +4,9 @@ export * from "./commands/CloseTunnelCommand"; export * from "./commands/DescribeTunnelCommand"; export * from "./commands/ListTagsForResourceCommand"; export * from "./commands/ListTunnelsCommand"; +export * from "./pagination/ListTunnelsPaginator"; export * from "./commands/OpenTunnelCommand"; export * from "./commands/TagResourceCommand"; export * from "./commands/UntagResourceCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-iotsecuretunneling/pagination/Interfaces.ts b/clients/client-iotsecuretunneling/pagination/Interfaces.ts new file mode 100644 index 0000000000000..467b1db471621 --- /dev/null +++ b/clients/client-iotsecuretunneling/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { IoTSecureTunneling } from "../IoTSecureTunneling"; +import { IoTSecureTunnelingClient } from "../IoTSecureTunnelingClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface IoTSecureTunnelingPaginationConfiguration extends PaginationConfiguration { + client: IoTSecureTunneling | IoTSecureTunnelingClient; +} diff --git a/clients/client-iotsecuretunneling/pagination/ListTunnelsPaginator.ts b/clients/client-iotsecuretunneling/pagination/ListTunnelsPaginator.ts new file mode 100644 index 0000000000000..0ee99bcf7966d --- /dev/null +++ b/clients/client-iotsecuretunneling/pagination/ListTunnelsPaginator.ts @@ -0,0 +1,47 @@ +import { IoTSecureTunneling } from "../IoTSecureTunneling"; +import { IoTSecureTunnelingClient } from "../IoTSecureTunnelingClient"; +import { ListTunnelsCommand, ListTunnelsCommandInput, ListTunnelsCommandOutput } from "../commands/ListTunnelsCommand"; +import { IoTSecureTunnelingPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IoTSecureTunnelingClient, + input: ListTunnelsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTunnelsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IoTSecureTunneling, + input: ListTunnelsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTunnels(input, ...args); +}; +export async function* listTunnelsPaginate( + config: IoTSecureTunnelingPaginationConfiguration, + input: ListTunnelsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTunnelsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof IoTSecureTunneling) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IoTSecureTunnelingClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IoTSecureTunneling | IoTSecureTunnelingClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iotsitewise/index.ts b/clients/client-iotsitewise/index.ts index f006d2831a464..581f68bf5c667 100644 --- a/clients/client-iotsitewise/index.ts +++ b/clients/client-iotsitewise/index.ts @@ -30,17 +30,28 @@ export * from "./commands/DescribePortalCommand"; export * from "./commands/DescribeProjectCommand"; export * from "./commands/DisassociateAssetsCommand"; export * from "./commands/GetAssetPropertyAggregatesCommand"; +export * from "./pagination/GetAssetPropertyAggregatesPaginator"; export * from "./commands/GetAssetPropertyValueCommand"; export * from "./commands/GetAssetPropertyValueHistoryCommand"; +export * from "./pagination/GetAssetPropertyValueHistoryPaginator"; export * from "./commands/ListAccessPoliciesCommand"; +export * from "./pagination/ListAccessPoliciesPaginator"; export * from "./commands/ListAssetModelsCommand"; +export * from "./pagination/ListAssetModelsPaginator"; export * from "./commands/ListAssetsCommand"; +export * from "./pagination/ListAssetsPaginator"; export * from "./commands/ListAssociatedAssetsCommand"; +export * from "./pagination/ListAssociatedAssetsPaginator"; export * from "./commands/ListDashboardsCommand"; +export * from "./pagination/ListDashboardsPaginator"; export * from "./commands/ListGatewaysCommand"; +export * from "./pagination/ListGatewaysPaginator"; export * from "./commands/ListPortalsCommand"; +export * from "./pagination/ListPortalsPaginator"; export * from "./commands/ListProjectAssetsCommand"; +export * from "./pagination/ListProjectAssetsPaginator"; export * from "./commands/ListProjectsCommand"; +export * from "./pagination/ListProjectsPaginator"; export * from "./commands/ListTagsForResourceCommand"; export * from "./commands/PutLoggingOptionsCommand"; export * from "./commands/TagResourceCommand"; @@ -54,4 +65,5 @@ export * from "./commands/UpdateGatewayCommand"; export * from "./commands/UpdateGatewayCapabilityConfigurationCommand"; export * from "./commands/UpdatePortalCommand"; export * from "./commands/UpdateProjectCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-iotsitewise/pagination/GetAssetPropertyAggregatesPaginator.ts b/clients/client-iotsitewise/pagination/GetAssetPropertyAggregatesPaginator.ts new file mode 100644 index 0000000000000..de8547b1498fe --- /dev/null +++ b/clients/client-iotsitewise/pagination/GetAssetPropertyAggregatesPaginator.ts @@ -0,0 +1,51 @@ +import { IoTSiteWise } from "../IoTSiteWise"; +import { IoTSiteWiseClient } from "../IoTSiteWiseClient"; +import { + GetAssetPropertyAggregatesCommand, + GetAssetPropertyAggregatesCommandInput, + GetAssetPropertyAggregatesCommandOutput, +} from "../commands/GetAssetPropertyAggregatesCommand"; +import { IoTSiteWisePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IoTSiteWiseClient, + input: GetAssetPropertyAggregatesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetAssetPropertyAggregatesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IoTSiteWise, + input: GetAssetPropertyAggregatesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getAssetPropertyAggregates(input, ...args); +}; +export async function* getAssetPropertyAggregatesPaginate( + config: IoTSiteWisePaginationConfiguration, + input: GetAssetPropertyAggregatesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetAssetPropertyAggregatesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof IoTSiteWise) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IoTSiteWiseClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IoTSiteWise | IoTSiteWiseClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iotsitewise/pagination/GetAssetPropertyValueHistoryPaginator.ts b/clients/client-iotsitewise/pagination/GetAssetPropertyValueHistoryPaginator.ts new file mode 100644 index 0000000000000..8b41d03d887a9 --- /dev/null +++ b/clients/client-iotsitewise/pagination/GetAssetPropertyValueHistoryPaginator.ts @@ -0,0 +1,51 @@ +import { IoTSiteWise } from "../IoTSiteWise"; +import { IoTSiteWiseClient } from "../IoTSiteWiseClient"; +import { + GetAssetPropertyValueHistoryCommand, + GetAssetPropertyValueHistoryCommandInput, + GetAssetPropertyValueHistoryCommandOutput, +} from "../commands/GetAssetPropertyValueHistoryCommand"; +import { IoTSiteWisePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IoTSiteWiseClient, + input: GetAssetPropertyValueHistoryCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetAssetPropertyValueHistoryCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IoTSiteWise, + input: GetAssetPropertyValueHistoryCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getAssetPropertyValueHistory(input, ...args); +}; +export async function* getAssetPropertyValueHistoryPaginate( + config: IoTSiteWisePaginationConfiguration, + input: GetAssetPropertyValueHistoryCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetAssetPropertyValueHistoryCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof IoTSiteWise) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IoTSiteWiseClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IoTSiteWise | IoTSiteWiseClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iotsitewise/pagination/Interfaces.ts b/clients/client-iotsitewise/pagination/Interfaces.ts new file mode 100644 index 0000000000000..0d87f6144146a --- /dev/null +++ b/clients/client-iotsitewise/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { IoTSiteWise } from "../IoTSiteWise"; +import { IoTSiteWiseClient } from "../IoTSiteWiseClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface IoTSiteWisePaginationConfiguration extends PaginationConfiguration { + client: IoTSiteWise | IoTSiteWiseClient; +} diff --git a/clients/client-iotsitewise/pagination/ListAccessPoliciesPaginator.ts b/clients/client-iotsitewise/pagination/ListAccessPoliciesPaginator.ts new file mode 100644 index 0000000000000..4667d70fe4f9f --- /dev/null +++ b/clients/client-iotsitewise/pagination/ListAccessPoliciesPaginator.ts @@ -0,0 +1,51 @@ +import { IoTSiteWise } from "../IoTSiteWise"; +import { IoTSiteWiseClient } from "../IoTSiteWiseClient"; +import { + ListAccessPoliciesCommand, + ListAccessPoliciesCommandInput, + ListAccessPoliciesCommandOutput, +} from "../commands/ListAccessPoliciesCommand"; +import { IoTSiteWisePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IoTSiteWiseClient, + input: ListAccessPoliciesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListAccessPoliciesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IoTSiteWise, + input: ListAccessPoliciesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listAccessPolicies(input, ...args); +}; +export async function* listAccessPoliciesPaginate( + config: IoTSiteWisePaginationConfiguration, + input: ListAccessPoliciesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListAccessPoliciesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof IoTSiteWise) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IoTSiteWiseClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IoTSiteWise | IoTSiteWiseClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iotsitewise/pagination/ListAssetModelsPaginator.ts b/clients/client-iotsitewise/pagination/ListAssetModelsPaginator.ts new file mode 100644 index 0000000000000..5be8fbcedb31f --- /dev/null +++ b/clients/client-iotsitewise/pagination/ListAssetModelsPaginator.ts @@ -0,0 +1,51 @@ +import { IoTSiteWise } from "../IoTSiteWise"; +import { IoTSiteWiseClient } from "../IoTSiteWiseClient"; +import { + ListAssetModelsCommand, + ListAssetModelsCommandInput, + ListAssetModelsCommandOutput, +} from "../commands/ListAssetModelsCommand"; +import { IoTSiteWisePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IoTSiteWiseClient, + input: ListAssetModelsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListAssetModelsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IoTSiteWise, + input: ListAssetModelsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listAssetModels(input, ...args); +}; +export async function* listAssetModelsPaginate( + config: IoTSiteWisePaginationConfiguration, + input: ListAssetModelsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListAssetModelsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof IoTSiteWise) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IoTSiteWiseClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IoTSiteWise | IoTSiteWiseClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iotsitewise/pagination/ListAssetsPaginator.ts b/clients/client-iotsitewise/pagination/ListAssetsPaginator.ts new file mode 100644 index 0000000000000..5af07a2dfeacb --- /dev/null +++ b/clients/client-iotsitewise/pagination/ListAssetsPaginator.ts @@ -0,0 +1,47 @@ +import { IoTSiteWise } from "../IoTSiteWise"; +import { IoTSiteWiseClient } from "../IoTSiteWiseClient"; +import { ListAssetsCommand, ListAssetsCommandInput, ListAssetsCommandOutput } from "../commands/ListAssetsCommand"; +import { IoTSiteWisePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IoTSiteWiseClient, + input: ListAssetsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListAssetsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IoTSiteWise, + input: ListAssetsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listAssets(input, ...args); +}; +export async function* listAssetsPaginate( + config: IoTSiteWisePaginationConfiguration, + input: ListAssetsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListAssetsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof IoTSiteWise) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IoTSiteWiseClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IoTSiteWise | IoTSiteWiseClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iotsitewise/pagination/ListAssociatedAssetsPaginator.ts b/clients/client-iotsitewise/pagination/ListAssociatedAssetsPaginator.ts new file mode 100644 index 0000000000000..48ba246785595 --- /dev/null +++ b/clients/client-iotsitewise/pagination/ListAssociatedAssetsPaginator.ts @@ -0,0 +1,51 @@ +import { IoTSiteWise } from "../IoTSiteWise"; +import { IoTSiteWiseClient } from "../IoTSiteWiseClient"; +import { + ListAssociatedAssetsCommand, + ListAssociatedAssetsCommandInput, + ListAssociatedAssetsCommandOutput, +} from "../commands/ListAssociatedAssetsCommand"; +import { IoTSiteWisePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IoTSiteWiseClient, + input: ListAssociatedAssetsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListAssociatedAssetsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IoTSiteWise, + input: ListAssociatedAssetsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listAssociatedAssets(input, ...args); +}; +export async function* listAssociatedAssetsPaginate( + config: IoTSiteWisePaginationConfiguration, + input: ListAssociatedAssetsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListAssociatedAssetsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof IoTSiteWise) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IoTSiteWiseClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IoTSiteWise | IoTSiteWiseClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iotsitewise/pagination/ListDashboardsPaginator.ts b/clients/client-iotsitewise/pagination/ListDashboardsPaginator.ts new file mode 100644 index 0000000000000..165f817a6471e --- /dev/null +++ b/clients/client-iotsitewise/pagination/ListDashboardsPaginator.ts @@ -0,0 +1,51 @@ +import { IoTSiteWise } from "../IoTSiteWise"; +import { IoTSiteWiseClient } from "../IoTSiteWiseClient"; +import { + ListDashboardsCommand, + ListDashboardsCommandInput, + ListDashboardsCommandOutput, +} from "../commands/ListDashboardsCommand"; +import { IoTSiteWisePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IoTSiteWiseClient, + input: ListDashboardsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDashboardsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IoTSiteWise, + input: ListDashboardsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDashboards(input, ...args); +}; +export async function* listDashboardsPaginate( + config: IoTSiteWisePaginationConfiguration, + input: ListDashboardsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDashboardsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof IoTSiteWise) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IoTSiteWiseClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IoTSiteWise | IoTSiteWiseClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iotsitewise/pagination/ListGatewaysPaginator.ts b/clients/client-iotsitewise/pagination/ListGatewaysPaginator.ts new file mode 100644 index 0000000000000..b25f06bb3ac0a --- /dev/null +++ b/clients/client-iotsitewise/pagination/ListGatewaysPaginator.ts @@ -0,0 +1,51 @@ +import { IoTSiteWise } from "../IoTSiteWise"; +import { IoTSiteWiseClient } from "../IoTSiteWiseClient"; +import { + ListGatewaysCommand, + ListGatewaysCommandInput, + ListGatewaysCommandOutput, +} from "../commands/ListGatewaysCommand"; +import { IoTSiteWisePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IoTSiteWiseClient, + input: ListGatewaysCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListGatewaysCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IoTSiteWise, + input: ListGatewaysCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listGateways(input, ...args); +}; +export async function* listGatewaysPaginate( + config: IoTSiteWisePaginationConfiguration, + input: ListGatewaysCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListGatewaysCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof IoTSiteWise) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IoTSiteWiseClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IoTSiteWise | IoTSiteWiseClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iotsitewise/pagination/ListPortalsPaginator.ts b/clients/client-iotsitewise/pagination/ListPortalsPaginator.ts new file mode 100644 index 0000000000000..aae8c86837233 --- /dev/null +++ b/clients/client-iotsitewise/pagination/ListPortalsPaginator.ts @@ -0,0 +1,47 @@ +import { IoTSiteWise } from "../IoTSiteWise"; +import { IoTSiteWiseClient } from "../IoTSiteWiseClient"; +import { ListPortalsCommand, ListPortalsCommandInput, ListPortalsCommandOutput } from "../commands/ListPortalsCommand"; +import { IoTSiteWisePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IoTSiteWiseClient, + input: ListPortalsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListPortalsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IoTSiteWise, + input: ListPortalsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listPortals(input, ...args); +}; +export async function* listPortalsPaginate( + config: IoTSiteWisePaginationConfiguration, + input: ListPortalsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListPortalsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof IoTSiteWise) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IoTSiteWiseClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IoTSiteWise | IoTSiteWiseClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iotsitewise/pagination/ListProjectAssetsPaginator.ts b/clients/client-iotsitewise/pagination/ListProjectAssetsPaginator.ts new file mode 100644 index 0000000000000..0737b19826dc6 --- /dev/null +++ b/clients/client-iotsitewise/pagination/ListProjectAssetsPaginator.ts @@ -0,0 +1,51 @@ +import { IoTSiteWise } from "../IoTSiteWise"; +import { IoTSiteWiseClient } from "../IoTSiteWiseClient"; +import { + ListProjectAssetsCommand, + ListProjectAssetsCommandInput, + ListProjectAssetsCommandOutput, +} from "../commands/ListProjectAssetsCommand"; +import { IoTSiteWisePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IoTSiteWiseClient, + input: ListProjectAssetsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListProjectAssetsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IoTSiteWise, + input: ListProjectAssetsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listProjectAssets(input, ...args); +}; +export async function* listProjectAssetsPaginate( + config: IoTSiteWisePaginationConfiguration, + input: ListProjectAssetsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListProjectAssetsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof IoTSiteWise) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IoTSiteWiseClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IoTSiteWise | IoTSiteWiseClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iotsitewise/pagination/ListProjectsPaginator.ts b/clients/client-iotsitewise/pagination/ListProjectsPaginator.ts new file mode 100644 index 0000000000000..d3e1f601a719f --- /dev/null +++ b/clients/client-iotsitewise/pagination/ListProjectsPaginator.ts @@ -0,0 +1,51 @@ +import { IoTSiteWise } from "../IoTSiteWise"; +import { IoTSiteWiseClient } from "../IoTSiteWiseClient"; +import { + ListProjectsCommand, + ListProjectsCommandInput, + ListProjectsCommandOutput, +} from "../commands/ListProjectsCommand"; +import { IoTSiteWisePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IoTSiteWiseClient, + input: ListProjectsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListProjectsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IoTSiteWise, + input: ListProjectsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listProjects(input, ...args); +}; +export async function* listProjectsPaginate( + config: IoTSiteWisePaginationConfiguration, + input: ListProjectsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListProjectsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof IoTSiteWise) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IoTSiteWiseClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IoTSiteWise | IoTSiteWiseClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iotthingsgraph/index.ts b/clients/client-iotthingsgraph/index.ts index 4a0b2eb562bb5..53296dcbc7279 100644 --- a/clients/client-iotthingsgraph/index.ts +++ b/clients/client-iotthingsgraph/index.ts @@ -16,23 +16,34 @@ export * from "./commands/DissociateEntityFromThingCommand"; export * from "./commands/GetEntitiesCommand"; export * from "./commands/GetFlowTemplateCommand"; export * from "./commands/GetFlowTemplateRevisionsCommand"; +export * from "./pagination/GetFlowTemplateRevisionsPaginator"; export * from "./commands/GetNamespaceDeletionStatusCommand"; export * from "./commands/GetSystemInstanceCommand"; export * from "./commands/GetSystemTemplateCommand"; export * from "./commands/GetSystemTemplateRevisionsCommand"; +export * from "./pagination/GetSystemTemplateRevisionsPaginator"; export * from "./commands/GetUploadStatusCommand"; export * from "./commands/ListFlowExecutionMessagesCommand"; +export * from "./pagination/ListFlowExecutionMessagesPaginator"; export * from "./commands/ListTagsForResourceCommand"; +export * from "./pagination/ListTagsForResourcePaginator"; export * from "./commands/SearchEntitiesCommand"; +export * from "./pagination/SearchEntitiesPaginator"; export * from "./commands/SearchFlowExecutionsCommand"; +export * from "./pagination/SearchFlowExecutionsPaginator"; export * from "./commands/SearchFlowTemplatesCommand"; +export * from "./pagination/SearchFlowTemplatesPaginator"; export * from "./commands/SearchSystemInstancesCommand"; +export * from "./pagination/SearchSystemInstancesPaginator"; export * from "./commands/SearchSystemTemplatesCommand"; +export * from "./pagination/SearchSystemTemplatesPaginator"; export * from "./commands/SearchThingsCommand"; +export * from "./pagination/SearchThingsPaginator"; export * from "./commands/TagResourceCommand"; export * from "./commands/UndeploySystemInstanceCommand"; export * from "./commands/UntagResourceCommand"; export * from "./commands/UpdateFlowTemplateCommand"; export * from "./commands/UpdateSystemTemplateCommand"; export * from "./commands/UploadEntityDefinitionsCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-iotthingsgraph/pagination/GetFlowTemplateRevisionsPaginator.ts b/clients/client-iotthingsgraph/pagination/GetFlowTemplateRevisionsPaginator.ts new file mode 100644 index 0000000000000..6d08552bdf88f --- /dev/null +++ b/clients/client-iotthingsgraph/pagination/GetFlowTemplateRevisionsPaginator.ts @@ -0,0 +1,51 @@ +import { IoTThingsGraph } from "../IoTThingsGraph"; +import { IoTThingsGraphClient } from "../IoTThingsGraphClient"; +import { + GetFlowTemplateRevisionsCommand, + GetFlowTemplateRevisionsCommandInput, + GetFlowTemplateRevisionsCommandOutput, +} from "../commands/GetFlowTemplateRevisionsCommand"; +import { IoTThingsGraphPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IoTThingsGraphClient, + input: GetFlowTemplateRevisionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetFlowTemplateRevisionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IoTThingsGraph, + input: GetFlowTemplateRevisionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getFlowTemplateRevisions(input, ...args); +}; +export async function* getFlowTemplateRevisionsPaginate( + config: IoTThingsGraphPaginationConfiguration, + input: GetFlowTemplateRevisionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetFlowTemplateRevisionsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof IoTThingsGraph) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IoTThingsGraphClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IoTThingsGraph | IoTThingsGraphClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iotthingsgraph/pagination/GetSystemTemplateRevisionsPaginator.ts b/clients/client-iotthingsgraph/pagination/GetSystemTemplateRevisionsPaginator.ts new file mode 100644 index 0000000000000..0eb31484db6fe --- /dev/null +++ b/clients/client-iotthingsgraph/pagination/GetSystemTemplateRevisionsPaginator.ts @@ -0,0 +1,51 @@ +import { IoTThingsGraph } from "../IoTThingsGraph"; +import { IoTThingsGraphClient } from "../IoTThingsGraphClient"; +import { + GetSystemTemplateRevisionsCommand, + GetSystemTemplateRevisionsCommandInput, + GetSystemTemplateRevisionsCommandOutput, +} from "../commands/GetSystemTemplateRevisionsCommand"; +import { IoTThingsGraphPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IoTThingsGraphClient, + input: GetSystemTemplateRevisionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetSystemTemplateRevisionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IoTThingsGraph, + input: GetSystemTemplateRevisionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getSystemTemplateRevisions(input, ...args); +}; +export async function* getSystemTemplateRevisionsPaginate( + config: IoTThingsGraphPaginationConfiguration, + input: GetSystemTemplateRevisionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetSystemTemplateRevisionsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof IoTThingsGraph) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IoTThingsGraphClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IoTThingsGraph | IoTThingsGraphClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iotthingsgraph/pagination/Interfaces.ts b/clients/client-iotthingsgraph/pagination/Interfaces.ts new file mode 100644 index 0000000000000..4942bf5324d34 --- /dev/null +++ b/clients/client-iotthingsgraph/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { IoTThingsGraph } from "../IoTThingsGraph"; +import { IoTThingsGraphClient } from "../IoTThingsGraphClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface IoTThingsGraphPaginationConfiguration extends PaginationConfiguration { + client: IoTThingsGraph | IoTThingsGraphClient; +} diff --git a/clients/client-iotthingsgraph/pagination/ListFlowExecutionMessagesPaginator.ts b/clients/client-iotthingsgraph/pagination/ListFlowExecutionMessagesPaginator.ts new file mode 100644 index 0000000000000..9217c13745609 --- /dev/null +++ b/clients/client-iotthingsgraph/pagination/ListFlowExecutionMessagesPaginator.ts @@ -0,0 +1,51 @@ +import { IoTThingsGraph } from "../IoTThingsGraph"; +import { IoTThingsGraphClient } from "../IoTThingsGraphClient"; +import { + ListFlowExecutionMessagesCommand, + ListFlowExecutionMessagesCommandInput, + ListFlowExecutionMessagesCommandOutput, +} from "../commands/ListFlowExecutionMessagesCommand"; +import { IoTThingsGraphPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IoTThingsGraphClient, + input: ListFlowExecutionMessagesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListFlowExecutionMessagesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IoTThingsGraph, + input: ListFlowExecutionMessagesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listFlowExecutionMessages(input, ...args); +}; +export async function* listFlowExecutionMessagesPaginate( + config: IoTThingsGraphPaginationConfiguration, + input: ListFlowExecutionMessagesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListFlowExecutionMessagesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof IoTThingsGraph) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IoTThingsGraphClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IoTThingsGraph | IoTThingsGraphClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iotthingsgraph/pagination/ListTagsForResourcePaginator.ts b/clients/client-iotthingsgraph/pagination/ListTagsForResourcePaginator.ts new file mode 100644 index 0000000000000..011c8864bba4f --- /dev/null +++ b/clients/client-iotthingsgraph/pagination/ListTagsForResourcePaginator.ts @@ -0,0 +1,51 @@ +import { IoTThingsGraph } from "../IoTThingsGraph"; +import { IoTThingsGraphClient } from "../IoTThingsGraphClient"; +import { + ListTagsForResourceCommand, + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput, +} from "../commands/ListTagsForResourceCommand"; +import { IoTThingsGraphPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IoTThingsGraphClient, + input: ListTagsForResourceCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTagsForResourceCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IoTThingsGraph, + input: ListTagsForResourceCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTagsForResource(input, ...args); +}; +export async function* listTagsForResourcePaginate( + config: IoTThingsGraphPaginationConfiguration, + input: ListTagsForResourceCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTagsForResourceCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof IoTThingsGraph) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IoTThingsGraphClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IoTThingsGraph | IoTThingsGraphClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iotthingsgraph/pagination/SearchEntitiesPaginator.ts b/clients/client-iotthingsgraph/pagination/SearchEntitiesPaginator.ts new file mode 100644 index 0000000000000..af31db5241e71 --- /dev/null +++ b/clients/client-iotthingsgraph/pagination/SearchEntitiesPaginator.ts @@ -0,0 +1,51 @@ +import { IoTThingsGraph } from "../IoTThingsGraph"; +import { IoTThingsGraphClient } from "../IoTThingsGraphClient"; +import { + SearchEntitiesCommand, + SearchEntitiesCommandInput, + SearchEntitiesCommandOutput, +} from "../commands/SearchEntitiesCommand"; +import { IoTThingsGraphPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IoTThingsGraphClient, + input: SearchEntitiesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new SearchEntitiesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IoTThingsGraph, + input: SearchEntitiesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.searchEntities(input, ...args); +}; +export async function* searchEntitiesPaginate( + config: IoTThingsGraphPaginationConfiguration, + input: SearchEntitiesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: SearchEntitiesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof IoTThingsGraph) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IoTThingsGraphClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IoTThingsGraph | IoTThingsGraphClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iotthingsgraph/pagination/SearchFlowExecutionsPaginator.ts b/clients/client-iotthingsgraph/pagination/SearchFlowExecutionsPaginator.ts new file mode 100644 index 0000000000000..a6acbe806fd8b --- /dev/null +++ b/clients/client-iotthingsgraph/pagination/SearchFlowExecutionsPaginator.ts @@ -0,0 +1,51 @@ +import { IoTThingsGraph } from "../IoTThingsGraph"; +import { IoTThingsGraphClient } from "../IoTThingsGraphClient"; +import { + SearchFlowExecutionsCommand, + SearchFlowExecutionsCommandInput, + SearchFlowExecutionsCommandOutput, +} from "../commands/SearchFlowExecutionsCommand"; +import { IoTThingsGraphPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IoTThingsGraphClient, + input: SearchFlowExecutionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new SearchFlowExecutionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IoTThingsGraph, + input: SearchFlowExecutionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.searchFlowExecutions(input, ...args); +}; +export async function* searchFlowExecutionsPaginate( + config: IoTThingsGraphPaginationConfiguration, + input: SearchFlowExecutionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: SearchFlowExecutionsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof IoTThingsGraph) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IoTThingsGraphClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IoTThingsGraph | IoTThingsGraphClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iotthingsgraph/pagination/SearchFlowTemplatesPaginator.ts b/clients/client-iotthingsgraph/pagination/SearchFlowTemplatesPaginator.ts new file mode 100644 index 0000000000000..cfdde4bd31de4 --- /dev/null +++ b/clients/client-iotthingsgraph/pagination/SearchFlowTemplatesPaginator.ts @@ -0,0 +1,51 @@ +import { IoTThingsGraph } from "../IoTThingsGraph"; +import { IoTThingsGraphClient } from "../IoTThingsGraphClient"; +import { + SearchFlowTemplatesCommand, + SearchFlowTemplatesCommandInput, + SearchFlowTemplatesCommandOutput, +} from "../commands/SearchFlowTemplatesCommand"; +import { IoTThingsGraphPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IoTThingsGraphClient, + input: SearchFlowTemplatesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new SearchFlowTemplatesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IoTThingsGraph, + input: SearchFlowTemplatesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.searchFlowTemplates(input, ...args); +}; +export async function* searchFlowTemplatesPaginate( + config: IoTThingsGraphPaginationConfiguration, + input: SearchFlowTemplatesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: SearchFlowTemplatesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof IoTThingsGraph) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IoTThingsGraphClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IoTThingsGraph | IoTThingsGraphClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iotthingsgraph/pagination/SearchSystemInstancesPaginator.ts b/clients/client-iotthingsgraph/pagination/SearchSystemInstancesPaginator.ts new file mode 100644 index 0000000000000..c04989ad16842 --- /dev/null +++ b/clients/client-iotthingsgraph/pagination/SearchSystemInstancesPaginator.ts @@ -0,0 +1,51 @@ +import { IoTThingsGraph } from "../IoTThingsGraph"; +import { IoTThingsGraphClient } from "../IoTThingsGraphClient"; +import { + SearchSystemInstancesCommand, + SearchSystemInstancesCommandInput, + SearchSystemInstancesCommandOutput, +} from "../commands/SearchSystemInstancesCommand"; +import { IoTThingsGraphPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IoTThingsGraphClient, + input: SearchSystemInstancesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new SearchSystemInstancesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IoTThingsGraph, + input: SearchSystemInstancesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.searchSystemInstances(input, ...args); +}; +export async function* searchSystemInstancesPaginate( + config: IoTThingsGraphPaginationConfiguration, + input: SearchSystemInstancesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: SearchSystemInstancesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof IoTThingsGraph) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IoTThingsGraphClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IoTThingsGraph | IoTThingsGraphClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iotthingsgraph/pagination/SearchSystemTemplatesPaginator.ts b/clients/client-iotthingsgraph/pagination/SearchSystemTemplatesPaginator.ts new file mode 100644 index 0000000000000..17d599fb1dccd --- /dev/null +++ b/clients/client-iotthingsgraph/pagination/SearchSystemTemplatesPaginator.ts @@ -0,0 +1,51 @@ +import { IoTThingsGraph } from "../IoTThingsGraph"; +import { IoTThingsGraphClient } from "../IoTThingsGraphClient"; +import { + SearchSystemTemplatesCommand, + SearchSystemTemplatesCommandInput, + SearchSystemTemplatesCommandOutput, +} from "../commands/SearchSystemTemplatesCommand"; +import { IoTThingsGraphPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IoTThingsGraphClient, + input: SearchSystemTemplatesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new SearchSystemTemplatesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IoTThingsGraph, + input: SearchSystemTemplatesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.searchSystemTemplates(input, ...args); +}; +export async function* searchSystemTemplatesPaginate( + config: IoTThingsGraphPaginationConfiguration, + input: SearchSystemTemplatesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: SearchSystemTemplatesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof IoTThingsGraph) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IoTThingsGraphClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IoTThingsGraph | IoTThingsGraphClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-iotthingsgraph/pagination/SearchThingsPaginator.ts b/clients/client-iotthingsgraph/pagination/SearchThingsPaginator.ts new file mode 100644 index 0000000000000..3b05215f08e43 --- /dev/null +++ b/clients/client-iotthingsgraph/pagination/SearchThingsPaginator.ts @@ -0,0 +1,51 @@ +import { IoTThingsGraph } from "../IoTThingsGraph"; +import { IoTThingsGraphClient } from "../IoTThingsGraphClient"; +import { + SearchThingsCommand, + SearchThingsCommandInput, + SearchThingsCommandOutput, +} from "../commands/SearchThingsCommand"; +import { IoTThingsGraphPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IoTThingsGraphClient, + input: SearchThingsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new SearchThingsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: IoTThingsGraph, + input: SearchThingsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.searchThings(input, ...args); +}; +export async function* searchThingsPaginate( + config: IoTThingsGraphPaginationConfiguration, + input: SearchThingsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: SearchThingsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof IoTThingsGraph) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IoTThingsGraphClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected IoTThingsGraph | IoTThingsGraphClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-ivs/index.ts b/clients/client-ivs/index.ts index 51235e034031f..38d12275b3855 100644 --- a/clients/client-ivs/index.ts +++ b/clients/client-ivs/index.ts @@ -10,12 +10,17 @@ export * from "./commands/GetChannelCommand"; export * from "./commands/GetStreamCommand"; export * from "./commands/GetStreamKeyCommand"; export * from "./commands/ListChannelsCommand"; +export * from "./pagination/ListChannelsPaginator"; export * from "./commands/ListStreamKeysCommand"; +export * from "./pagination/ListStreamKeysPaginator"; export * from "./commands/ListStreamsCommand"; +export * from "./pagination/ListStreamsPaginator"; export * from "./commands/ListTagsForResourceCommand"; +export * from "./pagination/ListTagsForResourcePaginator"; export * from "./commands/PutMetadataCommand"; export * from "./commands/StopStreamCommand"; export * from "./commands/TagResourceCommand"; export * from "./commands/UntagResourceCommand"; export * from "./commands/UpdateChannelCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-ivs/pagination/Interfaces.ts b/clients/client-ivs/pagination/Interfaces.ts new file mode 100644 index 0000000000000..ed38208092baa --- /dev/null +++ b/clients/client-ivs/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { Ivs } from "../Ivs"; +import { IvsClient } from "../IvsClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface IvsPaginationConfiguration extends PaginationConfiguration { + client: Ivs | IvsClient; +} diff --git a/clients/client-ivs/pagination/ListChannelsPaginator.ts b/clients/client-ivs/pagination/ListChannelsPaginator.ts new file mode 100644 index 0000000000000..690f3113dfdf2 --- /dev/null +++ b/clients/client-ivs/pagination/ListChannelsPaginator.ts @@ -0,0 +1,51 @@ +import { Ivs } from "../Ivs"; +import { IvsClient } from "../IvsClient"; +import { + ListChannelsCommand, + ListChannelsCommandInput, + ListChannelsCommandOutput, +} from "../commands/ListChannelsCommand"; +import { IvsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IvsClient, + input: ListChannelsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListChannelsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Ivs, + input: ListChannelsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listChannels(input, ...args); +}; +export async function* listChannelsPaginate( + config: IvsPaginationConfiguration, + input: ListChannelsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListChannelsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof Ivs) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IvsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Ivs | IvsClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-ivs/pagination/ListStreamKeysPaginator.ts b/clients/client-ivs/pagination/ListStreamKeysPaginator.ts new file mode 100644 index 0000000000000..27c7ba1f5a16f --- /dev/null +++ b/clients/client-ivs/pagination/ListStreamKeysPaginator.ts @@ -0,0 +1,51 @@ +import { Ivs } from "../Ivs"; +import { IvsClient } from "../IvsClient"; +import { + ListStreamKeysCommand, + ListStreamKeysCommandInput, + ListStreamKeysCommandOutput, +} from "../commands/ListStreamKeysCommand"; +import { IvsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IvsClient, + input: ListStreamKeysCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListStreamKeysCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Ivs, + input: ListStreamKeysCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listStreamKeys(input, ...args); +}; +export async function* listStreamKeysPaginate( + config: IvsPaginationConfiguration, + input: ListStreamKeysCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListStreamKeysCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof Ivs) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IvsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Ivs | IvsClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-ivs/pagination/ListStreamsPaginator.ts b/clients/client-ivs/pagination/ListStreamsPaginator.ts new file mode 100644 index 0000000000000..ec45f59566085 --- /dev/null +++ b/clients/client-ivs/pagination/ListStreamsPaginator.ts @@ -0,0 +1,47 @@ +import { Ivs } from "../Ivs"; +import { IvsClient } from "../IvsClient"; +import { ListStreamsCommand, ListStreamsCommandInput, ListStreamsCommandOutput } from "../commands/ListStreamsCommand"; +import { IvsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IvsClient, + input: ListStreamsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListStreamsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Ivs, + input: ListStreamsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listStreams(input, ...args); +}; +export async function* listStreamsPaginate( + config: IvsPaginationConfiguration, + input: ListStreamsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListStreamsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof Ivs) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IvsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Ivs | IvsClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-ivs/pagination/ListTagsForResourcePaginator.ts b/clients/client-ivs/pagination/ListTagsForResourcePaginator.ts new file mode 100644 index 0000000000000..33595f5753da7 --- /dev/null +++ b/clients/client-ivs/pagination/ListTagsForResourcePaginator.ts @@ -0,0 +1,51 @@ +import { Ivs } from "../Ivs"; +import { IvsClient } from "../IvsClient"; +import { + ListTagsForResourceCommand, + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput, +} from "../commands/ListTagsForResourceCommand"; +import { IvsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: IvsClient, + input: ListTagsForResourceCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTagsForResourceCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Ivs, + input: ListTagsForResourceCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTagsForResource(input, ...args); +}; +export async function* listTagsForResourcePaginate( + config: IvsPaginationConfiguration, + input: ListTagsForResourceCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTagsForResourceCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof Ivs) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof IvsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Ivs | IvsClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-kendra/index.ts b/clients/client-kendra/index.ts index e32bfbc218902..262983160fb08 100644 --- a/clients/client-kendra/index.ts +++ b/clients/client-kendra/index.ts @@ -12,9 +12,12 @@ export * from "./commands/DescribeDataSourceCommand"; export * from "./commands/DescribeFaqCommand"; export * from "./commands/DescribeIndexCommand"; export * from "./commands/ListDataSourcesCommand"; +export * from "./pagination/ListDataSourcesPaginator"; export * from "./commands/ListDataSourceSyncJobsCommand"; +export * from "./pagination/ListDataSourceSyncJobsPaginator"; export * from "./commands/ListFaqsCommand"; export * from "./commands/ListIndicesCommand"; +export * from "./pagination/ListIndicesPaginator"; export * from "./commands/ListTagsForResourceCommand"; export * from "./commands/QueryCommand"; export * from "./commands/StartDataSourceSyncJobCommand"; @@ -24,4 +27,5 @@ export * from "./commands/TagResourceCommand"; export * from "./commands/UntagResourceCommand"; export * from "./commands/UpdateDataSourceCommand"; export * from "./commands/UpdateIndexCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-kendra/pagination/Interfaces.ts b/clients/client-kendra/pagination/Interfaces.ts new file mode 100644 index 0000000000000..111b142c097e8 --- /dev/null +++ b/clients/client-kendra/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { Kendra } from "../Kendra"; +import { KendraClient } from "../KendraClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface KendraPaginationConfiguration extends PaginationConfiguration { + client: Kendra | KendraClient; +} diff --git a/clients/client-kendra/pagination/ListDataSourceSyncJobsPaginator.ts b/clients/client-kendra/pagination/ListDataSourceSyncJobsPaginator.ts new file mode 100644 index 0000000000000..c4b476e4e3bbb --- /dev/null +++ b/clients/client-kendra/pagination/ListDataSourceSyncJobsPaginator.ts @@ -0,0 +1,51 @@ +import { Kendra } from "../Kendra"; +import { KendraClient } from "../KendraClient"; +import { + ListDataSourceSyncJobsCommand, + ListDataSourceSyncJobsCommandInput, + ListDataSourceSyncJobsCommandOutput, +} from "../commands/ListDataSourceSyncJobsCommand"; +import { KendraPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: KendraClient, + input: ListDataSourceSyncJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDataSourceSyncJobsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Kendra, + input: ListDataSourceSyncJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDataSourceSyncJobs(input, ...args); +}; +export async function* listDataSourceSyncJobsPaginate( + config: KendraPaginationConfiguration, + input: ListDataSourceSyncJobsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDataSourceSyncJobsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Kendra) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof KendraClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Kendra | KendraClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-kendra/pagination/ListDataSourcesPaginator.ts b/clients/client-kendra/pagination/ListDataSourcesPaginator.ts new file mode 100644 index 0000000000000..12baf15a58029 --- /dev/null +++ b/clients/client-kendra/pagination/ListDataSourcesPaginator.ts @@ -0,0 +1,51 @@ +import { Kendra } from "../Kendra"; +import { KendraClient } from "../KendraClient"; +import { + ListDataSourcesCommand, + ListDataSourcesCommandInput, + ListDataSourcesCommandOutput, +} from "../commands/ListDataSourcesCommand"; +import { KendraPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: KendraClient, + input: ListDataSourcesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDataSourcesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Kendra, + input: ListDataSourcesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDataSources(input, ...args); +}; +export async function* listDataSourcesPaginate( + config: KendraPaginationConfiguration, + input: ListDataSourcesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDataSourcesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Kendra) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof KendraClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Kendra | KendraClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-kendra/pagination/ListIndicesPaginator.ts b/clients/client-kendra/pagination/ListIndicesPaginator.ts new file mode 100644 index 0000000000000..13c27b3f37e40 --- /dev/null +++ b/clients/client-kendra/pagination/ListIndicesPaginator.ts @@ -0,0 +1,47 @@ +import { Kendra } from "../Kendra"; +import { KendraClient } from "../KendraClient"; +import { ListIndicesCommand, ListIndicesCommandInput, ListIndicesCommandOutput } from "../commands/ListIndicesCommand"; +import { KendraPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: KendraClient, + input: ListIndicesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListIndicesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Kendra, + input: ListIndicesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listIndices(input, ...args); +}; +export async function* listIndicesPaginate( + config: KendraPaginationConfiguration, + input: ListIndicesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListIndicesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Kendra) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof KendraClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Kendra | KendraClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-kinesis-video/index.ts b/clients/client-kinesis-video/index.ts index 5b39e3e55df46..5cc43bc99795f 100644 --- a/clients/client-kinesis-video/index.ts +++ b/clients/client-kinesis-video/index.ts @@ -9,7 +9,9 @@ export * from "./commands/DescribeStreamCommand"; export * from "./commands/GetDataEndpointCommand"; export * from "./commands/GetSignalingChannelEndpointCommand"; export * from "./commands/ListSignalingChannelsCommand"; +export * from "./pagination/ListSignalingChannelsPaginator"; export * from "./commands/ListStreamsCommand"; +export * from "./pagination/ListStreamsPaginator"; export * from "./commands/ListTagsForResourceCommand"; export * from "./commands/ListTagsForStreamCommand"; export * from "./commands/TagResourceCommand"; @@ -19,4 +21,5 @@ export * from "./commands/UntagStreamCommand"; export * from "./commands/UpdateDataRetentionCommand"; export * from "./commands/UpdateSignalingChannelCommand"; export * from "./commands/UpdateStreamCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-kinesis-video/pagination/Interfaces.ts b/clients/client-kinesis-video/pagination/Interfaces.ts new file mode 100644 index 0000000000000..13075049e6b2a --- /dev/null +++ b/clients/client-kinesis-video/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { KinesisVideo } from "../KinesisVideo"; +import { KinesisVideoClient } from "../KinesisVideoClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface KinesisVideoPaginationConfiguration extends PaginationConfiguration { + client: KinesisVideo | KinesisVideoClient; +} diff --git a/clients/client-kinesis-video/pagination/ListSignalingChannelsPaginator.ts b/clients/client-kinesis-video/pagination/ListSignalingChannelsPaginator.ts new file mode 100644 index 0000000000000..b71bd30d054af --- /dev/null +++ b/clients/client-kinesis-video/pagination/ListSignalingChannelsPaginator.ts @@ -0,0 +1,51 @@ +import { KinesisVideo } from "../KinesisVideo"; +import { KinesisVideoClient } from "../KinesisVideoClient"; +import { + ListSignalingChannelsCommand, + ListSignalingChannelsCommandInput, + ListSignalingChannelsCommandOutput, +} from "../commands/ListSignalingChannelsCommand"; +import { KinesisVideoPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: KinesisVideoClient, + input: ListSignalingChannelsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListSignalingChannelsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: KinesisVideo, + input: ListSignalingChannelsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listSignalingChannels(input, ...args); +}; +export async function* listSignalingChannelsPaginate( + config: KinesisVideoPaginationConfiguration, + input: ListSignalingChannelsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListSignalingChannelsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof KinesisVideo) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof KinesisVideoClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected KinesisVideo | KinesisVideoClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-kinesis-video/pagination/ListStreamsPaginator.ts b/clients/client-kinesis-video/pagination/ListStreamsPaginator.ts new file mode 100644 index 0000000000000..99ff5d7bf8c1e --- /dev/null +++ b/clients/client-kinesis-video/pagination/ListStreamsPaginator.ts @@ -0,0 +1,47 @@ +import { KinesisVideo } from "../KinesisVideo"; +import { KinesisVideoClient } from "../KinesisVideoClient"; +import { ListStreamsCommand, ListStreamsCommandInput, ListStreamsCommandOutput } from "../commands/ListStreamsCommand"; +import { KinesisVideoPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: KinesisVideoClient, + input: ListStreamsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListStreamsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: KinesisVideo, + input: ListStreamsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listStreams(input, ...args); +}; +export async function* listStreamsPaginate( + config: KinesisVideoPaginationConfiguration, + input: ListStreamsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListStreamsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof KinesisVideo) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof KinesisVideoClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected KinesisVideo | KinesisVideoClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-kinesis/index.ts b/clients/client-kinesis/index.ts index fc8f6e567bef5..03fc2860b8870 100644 --- a/clients/client-kinesis/index.ts +++ b/clients/client-kinesis/index.ts @@ -16,6 +16,7 @@ export * from "./commands/GetShardIteratorCommand"; export * from "./commands/IncreaseStreamRetentionPeriodCommand"; export * from "./commands/ListShardsCommand"; export * from "./commands/ListStreamConsumersCommand"; +export * from "./pagination/ListStreamConsumersPaginator"; export * from "./commands/ListStreamsCommand"; export * from "./commands/ListTagsForStreamCommand"; export * from "./commands/MergeShardsCommand"; @@ -28,4 +29,5 @@ export * from "./commands/StartStreamEncryptionCommand"; export * from "./commands/StopStreamEncryptionCommand"; export * from "./commands/SubscribeToShardCommand"; export * from "./commands/UpdateShardCountCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-kinesis/pagination/Interfaces.ts b/clients/client-kinesis/pagination/Interfaces.ts new file mode 100644 index 0000000000000..e51e8df6f15f4 --- /dev/null +++ b/clients/client-kinesis/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { Kinesis } from "../Kinesis"; +import { KinesisClient } from "../KinesisClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface KinesisPaginationConfiguration extends PaginationConfiguration { + client: Kinesis | KinesisClient; +} diff --git a/clients/client-kinesis/pagination/ListStreamConsumersPaginator.ts b/clients/client-kinesis/pagination/ListStreamConsumersPaginator.ts new file mode 100644 index 0000000000000..9cb3dbec07e68 --- /dev/null +++ b/clients/client-kinesis/pagination/ListStreamConsumersPaginator.ts @@ -0,0 +1,51 @@ +import { Kinesis } from "../Kinesis"; +import { KinesisClient } from "../KinesisClient"; +import { + ListStreamConsumersCommand, + ListStreamConsumersCommandInput, + ListStreamConsumersCommandOutput, +} from "../commands/ListStreamConsumersCommand"; +import { KinesisPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: KinesisClient, + input: ListStreamConsumersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListStreamConsumersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Kinesis, + input: ListStreamConsumersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listStreamConsumers(input, ...args); +}; +export async function* listStreamConsumersPaginate( + config: KinesisPaginationConfiguration, + input: ListStreamConsumersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListStreamConsumersCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Kinesis) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof KinesisClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Kinesis | KinesisClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-kms/index.ts b/clients/client-kms/index.ts index bf44ad6a9fa83..7b854241f07d2 100644 --- a/clients/client-kms/index.ts +++ b/clients/client-kms/index.ts @@ -29,9 +29,13 @@ export * from "./commands/GetParametersForImportCommand"; export * from "./commands/GetPublicKeyCommand"; export * from "./commands/ImportKeyMaterialCommand"; export * from "./commands/ListAliasesCommand"; +export * from "./pagination/ListAliasesPaginator"; export * from "./commands/ListGrantsCommand"; +export * from "./pagination/ListGrantsPaginator"; export * from "./commands/ListKeyPoliciesCommand"; +export * from "./pagination/ListKeyPoliciesPaginator"; export * from "./commands/ListKeysCommand"; +export * from "./pagination/ListKeysPaginator"; export * from "./commands/ListResourceTagsCommand"; export * from "./commands/ListRetirableGrantsCommand"; export * from "./commands/PutKeyPolicyCommand"; @@ -46,4 +50,5 @@ export * from "./commands/UpdateAliasCommand"; export * from "./commands/UpdateCustomKeyStoreCommand"; export * from "./commands/UpdateKeyDescriptionCommand"; export * from "./commands/VerifyCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-kms/pagination/Interfaces.ts b/clients/client-kms/pagination/Interfaces.ts new file mode 100644 index 0000000000000..6ddf265fe38c9 --- /dev/null +++ b/clients/client-kms/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { KMS } from "../KMS"; +import { KMSClient } from "../KMSClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface KMSPaginationConfiguration extends PaginationConfiguration { + client: KMS | KMSClient; +} diff --git a/clients/client-kms/pagination/ListAliasesPaginator.ts b/clients/client-kms/pagination/ListAliasesPaginator.ts new file mode 100644 index 0000000000000..ae1dd2625ed6c --- /dev/null +++ b/clients/client-kms/pagination/ListAliasesPaginator.ts @@ -0,0 +1,47 @@ +import { KMS } from "../KMS"; +import { KMSClient } from "../KMSClient"; +import { ListAliasesCommand, ListAliasesCommandInput, ListAliasesCommandOutput } from "../commands/ListAliasesCommand"; +import { KMSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: KMSClient, + input: ListAliasesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListAliasesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: KMS, + input: ListAliasesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listAliases(input, ...args); +}; +export async function* listAliasesPaginate( + config: KMSPaginationConfiguration, + input: ListAliasesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListAliasesCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["Limit"] = config.pageSize; + if (config.client instanceof KMS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof KMSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected KMS | KMSClient"); + } + yield page; + token = page["NextMarker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-kms/pagination/ListGrantsPaginator.ts b/clients/client-kms/pagination/ListGrantsPaginator.ts new file mode 100644 index 0000000000000..53d691bd5b3b2 --- /dev/null +++ b/clients/client-kms/pagination/ListGrantsPaginator.ts @@ -0,0 +1,47 @@ +import { KMS } from "../KMS"; +import { KMSClient } from "../KMSClient"; +import { ListGrantsCommand, ListGrantsCommandInput, ListGrantsCommandOutput } from "../commands/ListGrantsCommand"; +import { KMSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: KMSClient, + input: ListGrantsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListGrantsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: KMS, + input: ListGrantsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listGrants(input, ...args); +}; +export async function* listGrantsPaginate( + config: KMSPaginationConfiguration, + input: ListGrantsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListGrantsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["Limit"] = config.pageSize; + if (config.client instanceof KMS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof KMSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected KMS | KMSClient"); + } + yield page; + token = page["NextMarker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-kms/pagination/ListKeyPoliciesPaginator.ts b/clients/client-kms/pagination/ListKeyPoliciesPaginator.ts new file mode 100644 index 0000000000000..45b93e76eff6d --- /dev/null +++ b/clients/client-kms/pagination/ListKeyPoliciesPaginator.ts @@ -0,0 +1,51 @@ +import { KMS } from "../KMS"; +import { KMSClient } from "../KMSClient"; +import { + ListKeyPoliciesCommand, + ListKeyPoliciesCommandInput, + ListKeyPoliciesCommandOutput, +} from "../commands/ListKeyPoliciesCommand"; +import { KMSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: KMSClient, + input: ListKeyPoliciesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListKeyPoliciesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: KMS, + input: ListKeyPoliciesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listKeyPolicies(input, ...args); +}; +export async function* listKeyPoliciesPaginate( + config: KMSPaginationConfiguration, + input: ListKeyPoliciesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListKeyPoliciesCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["Limit"] = config.pageSize; + if (config.client instanceof KMS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof KMSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected KMS | KMSClient"); + } + yield page; + token = page["NextMarker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-kms/pagination/ListKeysPaginator.ts b/clients/client-kms/pagination/ListKeysPaginator.ts new file mode 100644 index 0000000000000..7d9737c658fdd --- /dev/null +++ b/clients/client-kms/pagination/ListKeysPaginator.ts @@ -0,0 +1,47 @@ +import { KMS } from "../KMS"; +import { KMSClient } from "../KMSClient"; +import { ListKeysCommand, ListKeysCommandInput, ListKeysCommandOutput } from "../commands/ListKeysCommand"; +import { KMSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: KMSClient, + input: ListKeysCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListKeysCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: KMS, + input: ListKeysCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listKeys(input, ...args); +}; +export async function* listKeysPaginate( + config: KMSPaginationConfiguration, + input: ListKeysCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListKeysCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["Limit"] = config.pageSize; + if (config.client instanceof KMS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof KMSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected KMS | KMSClient"); + } + yield page; + token = page["NextMarker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-lakeformation/index.ts b/clients/client-lakeformation/index.ts index a50851ec1f7b3..7ae309ecc3211 100644 --- a/clients/client-lakeformation/index.ts +++ b/clients/client-lakeformation/index.ts @@ -6,11 +6,15 @@ export * from "./commands/DeregisterResourceCommand"; export * from "./commands/DescribeResourceCommand"; export * from "./commands/GetDataLakeSettingsCommand"; export * from "./commands/GetEffectivePermissionsForPathCommand"; +export * from "./pagination/GetEffectivePermissionsForPathPaginator"; export * from "./commands/GrantPermissionsCommand"; export * from "./commands/ListPermissionsCommand"; +export * from "./pagination/ListPermissionsPaginator"; export * from "./commands/ListResourcesCommand"; +export * from "./pagination/ListResourcesPaginator"; export * from "./commands/PutDataLakeSettingsCommand"; export * from "./commands/RegisterResourceCommand"; export * from "./commands/RevokePermissionsCommand"; export * from "./commands/UpdateResourceCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-lakeformation/pagination/GetEffectivePermissionsForPathPaginator.ts b/clients/client-lakeformation/pagination/GetEffectivePermissionsForPathPaginator.ts new file mode 100644 index 0000000000000..dffa1dcba9f4e --- /dev/null +++ b/clients/client-lakeformation/pagination/GetEffectivePermissionsForPathPaginator.ts @@ -0,0 +1,51 @@ +import { LakeFormation } from "../LakeFormation"; +import { LakeFormationClient } from "../LakeFormationClient"; +import { + GetEffectivePermissionsForPathCommand, + GetEffectivePermissionsForPathCommandInput, + GetEffectivePermissionsForPathCommandOutput, +} from "../commands/GetEffectivePermissionsForPathCommand"; +import { LakeFormationPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: LakeFormationClient, + input: GetEffectivePermissionsForPathCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetEffectivePermissionsForPathCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: LakeFormation, + input: GetEffectivePermissionsForPathCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getEffectivePermissionsForPath(input, ...args); +}; +export async function* getEffectivePermissionsForPathPaginate( + config: LakeFormationPaginationConfiguration, + input: GetEffectivePermissionsForPathCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetEffectivePermissionsForPathCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof LakeFormation) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof LakeFormationClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected LakeFormation | LakeFormationClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-lakeformation/pagination/Interfaces.ts b/clients/client-lakeformation/pagination/Interfaces.ts new file mode 100644 index 0000000000000..9e2ebb97cd2c6 --- /dev/null +++ b/clients/client-lakeformation/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { LakeFormation } from "../LakeFormation"; +import { LakeFormationClient } from "../LakeFormationClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface LakeFormationPaginationConfiguration extends PaginationConfiguration { + client: LakeFormation | LakeFormationClient; +} diff --git a/clients/client-lakeformation/pagination/ListPermissionsPaginator.ts b/clients/client-lakeformation/pagination/ListPermissionsPaginator.ts new file mode 100644 index 0000000000000..056c70169a929 --- /dev/null +++ b/clients/client-lakeformation/pagination/ListPermissionsPaginator.ts @@ -0,0 +1,51 @@ +import { LakeFormation } from "../LakeFormation"; +import { LakeFormationClient } from "../LakeFormationClient"; +import { + ListPermissionsCommand, + ListPermissionsCommandInput, + ListPermissionsCommandOutput, +} from "../commands/ListPermissionsCommand"; +import { LakeFormationPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: LakeFormationClient, + input: ListPermissionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListPermissionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: LakeFormation, + input: ListPermissionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listPermissions(input, ...args); +}; +export async function* listPermissionsPaginate( + config: LakeFormationPaginationConfiguration, + input: ListPermissionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListPermissionsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof LakeFormation) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof LakeFormationClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected LakeFormation | LakeFormationClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-lakeformation/pagination/ListResourcesPaginator.ts b/clients/client-lakeformation/pagination/ListResourcesPaginator.ts new file mode 100644 index 0000000000000..7a61d9358ffbb --- /dev/null +++ b/clients/client-lakeformation/pagination/ListResourcesPaginator.ts @@ -0,0 +1,51 @@ +import { LakeFormation } from "../LakeFormation"; +import { LakeFormationClient } from "../LakeFormationClient"; +import { + ListResourcesCommand, + ListResourcesCommandInput, + ListResourcesCommandOutput, +} from "../commands/ListResourcesCommand"; +import { LakeFormationPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: LakeFormationClient, + input: ListResourcesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListResourcesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: LakeFormation, + input: ListResourcesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listResources(input, ...args); +}; +export async function* listResourcesPaginate( + config: LakeFormationPaginationConfiguration, + input: ListResourcesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListResourcesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof LakeFormation) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof LakeFormationClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected LakeFormation | LakeFormationClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-lambda/index.ts b/clients/client-lambda/index.ts index 1d1d5fecd327b..c89ad3bbd7657 100644 --- a/clients/client-lambda/index.ts +++ b/clients/client-lambda/index.ts @@ -27,14 +27,22 @@ export * from "./commands/GetProvisionedConcurrencyConfigCommand"; export * from "./commands/InvokeCommand"; export * from "./commands/InvokeAsyncCommand"; export * from "./commands/ListAliasesCommand"; +export * from "./pagination/ListAliasesPaginator"; export * from "./commands/ListEventSourceMappingsCommand"; +export * from "./pagination/ListEventSourceMappingsPaginator"; export * from "./commands/ListFunctionEventInvokeConfigsCommand"; +export * from "./pagination/ListFunctionEventInvokeConfigsPaginator"; export * from "./commands/ListFunctionsCommand"; +export * from "./pagination/ListFunctionsPaginator"; export * from "./commands/ListLayersCommand"; +export * from "./pagination/ListLayersPaginator"; export * from "./commands/ListLayerVersionsCommand"; +export * from "./pagination/ListLayerVersionsPaginator"; export * from "./commands/ListProvisionedConcurrencyConfigsCommand"; +export * from "./pagination/ListProvisionedConcurrencyConfigsPaginator"; export * from "./commands/ListTagsCommand"; export * from "./commands/ListVersionsByFunctionCommand"; +export * from "./pagination/ListVersionsByFunctionPaginator"; export * from "./commands/PublishLayerVersionCommand"; export * from "./commands/PublishVersionCommand"; export * from "./commands/PutFunctionConcurrencyCommand"; @@ -49,4 +57,5 @@ export * from "./commands/UpdateEventSourceMappingCommand"; export * from "./commands/UpdateFunctionCodeCommand"; export * from "./commands/UpdateFunctionConfigurationCommand"; export * from "./commands/UpdateFunctionEventInvokeConfigCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-lambda/pagination/Interfaces.ts b/clients/client-lambda/pagination/Interfaces.ts new file mode 100644 index 0000000000000..ee66cea3db9c9 --- /dev/null +++ b/clients/client-lambda/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { Lambda } from "../Lambda"; +import { LambdaClient } from "../LambdaClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface LambdaPaginationConfiguration extends PaginationConfiguration { + client: Lambda | LambdaClient; +} diff --git a/clients/client-lambda/pagination/ListAliasesPaginator.ts b/clients/client-lambda/pagination/ListAliasesPaginator.ts new file mode 100644 index 0000000000000..4356df5178901 --- /dev/null +++ b/clients/client-lambda/pagination/ListAliasesPaginator.ts @@ -0,0 +1,47 @@ +import { Lambda } from "../Lambda"; +import { LambdaClient } from "../LambdaClient"; +import { ListAliasesCommand, ListAliasesCommandInput, ListAliasesCommandOutput } from "../commands/ListAliasesCommand"; +import { LambdaPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: LambdaClient, + input: ListAliasesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListAliasesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Lambda, + input: ListAliasesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listAliases(input, ...args); +}; +export async function* listAliasesPaginate( + config: LambdaPaginationConfiguration, + input: ListAliasesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListAliasesCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxItems"] = config.pageSize; + if (config.client instanceof Lambda) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof LambdaClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Lambda | LambdaClient"); + } + yield page; + token = page["NextMarker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-lambda/pagination/ListEventSourceMappingsPaginator.ts b/clients/client-lambda/pagination/ListEventSourceMappingsPaginator.ts new file mode 100644 index 0000000000000..88d6e18f582ed --- /dev/null +++ b/clients/client-lambda/pagination/ListEventSourceMappingsPaginator.ts @@ -0,0 +1,51 @@ +import { Lambda } from "../Lambda"; +import { LambdaClient } from "../LambdaClient"; +import { + ListEventSourceMappingsCommand, + ListEventSourceMappingsCommandInput, + ListEventSourceMappingsCommandOutput, +} from "../commands/ListEventSourceMappingsCommand"; +import { LambdaPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: LambdaClient, + input: ListEventSourceMappingsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListEventSourceMappingsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Lambda, + input: ListEventSourceMappingsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listEventSourceMappings(input, ...args); +}; +export async function* listEventSourceMappingsPaginate( + config: LambdaPaginationConfiguration, + input: ListEventSourceMappingsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListEventSourceMappingsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxItems"] = config.pageSize; + if (config.client instanceof Lambda) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof LambdaClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Lambda | LambdaClient"); + } + yield page; + token = page["NextMarker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-lambda/pagination/ListFunctionEventInvokeConfigsPaginator.ts b/clients/client-lambda/pagination/ListFunctionEventInvokeConfigsPaginator.ts new file mode 100644 index 0000000000000..ee3b4ed3b0101 --- /dev/null +++ b/clients/client-lambda/pagination/ListFunctionEventInvokeConfigsPaginator.ts @@ -0,0 +1,51 @@ +import { Lambda } from "../Lambda"; +import { LambdaClient } from "../LambdaClient"; +import { + ListFunctionEventInvokeConfigsCommand, + ListFunctionEventInvokeConfigsCommandInput, + ListFunctionEventInvokeConfigsCommandOutput, +} from "../commands/ListFunctionEventInvokeConfigsCommand"; +import { LambdaPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: LambdaClient, + input: ListFunctionEventInvokeConfigsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListFunctionEventInvokeConfigsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Lambda, + input: ListFunctionEventInvokeConfigsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listFunctionEventInvokeConfigs(input, ...args); +}; +export async function* listFunctionEventInvokeConfigsPaginate( + config: LambdaPaginationConfiguration, + input: ListFunctionEventInvokeConfigsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListFunctionEventInvokeConfigsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxItems"] = config.pageSize; + if (config.client instanceof Lambda) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof LambdaClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Lambda | LambdaClient"); + } + yield page; + token = page["NextMarker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-lambda/pagination/ListFunctionsPaginator.ts b/clients/client-lambda/pagination/ListFunctionsPaginator.ts new file mode 100644 index 0000000000000..6e2f56d34b4d7 --- /dev/null +++ b/clients/client-lambda/pagination/ListFunctionsPaginator.ts @@ -0,0 +1,51 @@ +import { Lambda } from "../Lambda"; +import { LambdaClient } from "../LambdaClient"; +import { + ListFunctionsCommand, + ListFunctionsCommandInput, + ListFunctionsCommandOutput, +} from "../commands/ListFunctionsCommand"; +import { LambdaPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: LambdaClient, + input: ListFunctionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListFunctionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Lambda, + input: ListFunctionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listFunctions(input, ...args); +}; +export async function* listFunctionsPaginate( + config: LambdaPaginationConfiguration, + input: ListFunctionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListFunctionsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxItems"] = config.pageSize; + if (config.client instanceof Lambda) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof LambdaClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Lambda | LambdaClient"); + } + yield page; + token = page["NextMarker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-lambda/pagination/ListLayerVersionsPaginator.ts b/clients/client-lambda/pagination/ListLayerVersionsPaginator.ts new file mode 100644 index 0000000000000..6fc085b80dc20 --- /dev/null +++ b/clients/client-lambda/pagination/ListLayerVersionsPaginator.ts @@ -0,0 +1,51 @@ +import { Lambda } from "../Lambda"; +import { LambdaClient } from "../LambdaClient"; +import { + ListLayerVersionsCommand, + ListLayerVersionsCommandInput, + ListLayerVersionsCommandOutput, +} from "../commands/ListLayerVersionsCommand"; +import { LambdaPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: LambdaClient, + input: ListLayerVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListLayerVersionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Lambda, + input: ListLayerVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listLayerVersions(input, ...args); +}; +export async function* listLayerVersionsPaginate( + config: LambdaPaginationConfiguration, + input: ListLayerVersionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListLayerVersionsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxItems"] = config.pageSize; + if (config.client instanceof Lambda) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof LambdaClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Lambda | LambdaClient"); + } + yield page; + token = page["NextMarker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-lambda/pagination/ListLayersPaginator.ts b/clients/client-lambda/pagination/ListLayersPaginator.ts new file mode 100644 index 0000000000000..73fee232f7351 --- /dev/null +++ b/clients/client-lambda/pagination/ListLayersPaginator.ts @@ -0,0 +1,47 @@ +import { Lambda } from "../Lambda"; +import { LambdaClient } from "../LambdaClient"; +import { ListLayersCommand, ListLayersCommandInput, ListLayersCommandOutput } from "../commands/ListLayersCommand"; +import { LambdaPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: LambdaClient, + input: ListLayersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListLayersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Lambda, + input: ListLayersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listLayers(input, ...args); +}; +export async function* listLayersPaginate( + config: LambdaPaginationConfiguration, + input: ListLayersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListLayersCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxItems"] = config.pageSize; + if (config.client instanceof Lambda) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof LambdaClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Lambda | LambdaClient"); + } + yield page; + token = page["NextMarker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-lambda/pagination/ListProvisionedConcurrencyConfigsPaginator.ts b/clients/client-lambda/pagination/ListProvisionedConcurrencyConfigsPaginator.ts new file mode 100644 index 0000000000000..117494b32f03f --- /dev/null +++ b/clients/client-lambda/pagination/ListProvisionedConcurrencyConfigsPaginator.ts @@ -0,0 +1,51 @@ +import { Lambda } from "../Lambda"; +import { LambdaClient } from "../LambdaClient"; +import { + ListProvisionedConcurrencyConfigsCommand, + ListProvisionedConcurrencyConfigsCommandInput, + ListProvisionedConcurrencyConfigsCommandOutput, +} from "../commands/ListProvisionedConcurrencyConfigsCommand"; +import { LambdaPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: LambdaClient, + input: ListProvisionedConcurrencyConfigsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListProvisionedConcurrencyConfigsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Lambda, + input: ListProvisionedConcurrencyConfigsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listProvisionedConcurrencyConfigs(input, ...args); +}; +export async function* listProvisionedConcurrencyConfigsPaginate( + config: LambdaPaginationConfiguration, + input: ListProvisionedConcurrencyConfigsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListProvisionedConcurrencyConfigsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxItems"] = config.pageSize; + if (config.client instanceof Lambda) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof LambdaClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Lambda | LambdaClient"); + } + yield page; + token = page["NextMarker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-lambda/pagination/ListVersionsByFunctionPaginator.ts b/clients/client-lambda/pagination/ListVersionsByFunctionPaginator.ts new file mode 100644 index 0000000000000..1c9d29469a225 --- /dev/null +++ b/clients/client-lambda/pagination/ListVersionsByFunctionPaginator.ts @@ -0,0 +1,51 @@ +import { Lambda } from "../Lambda"; +import { LambdaClient } from "../LambdaClient"; +import { + ListVersionsByFunctionCommand, + ListVersionsByFunctionCommandInput, + ListVersionsByFunctionCommandOutput, +} from "../commands/ListVersionsByFunctionCommand"; +import { LambdaPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: LambdaClient, + input: ListVersionsByFunctionCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListVersionsByFunctionCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Lambda, + input: ListVersionsByFunctionCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listVersionsByFunction(input, ...args); +}; +export async function* listVersionsByFunctionPaginate( + config: LambdaPaginationConfiguration, + input: ListVersionsByFunctionCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListVersionsByFunctionCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxItems"] = config.pageSize; + if (config.client instanceof Lambda) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof LambdaClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Lambda | LambdaClient"); + } + yield page; + token = page["NextMarker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-lex-model-building-service/index.ts b/clients/client-lex-model-building-service/index.ts index 2ecd9e55312bf..76d6da2f4cccc 100644 --- a/clients/client-lex-model-building-service/index.ts +++ b/clients/client-lex-model-building-service/index.ts @@ -15,21 +15,31 @@ export * from "./commands/DeleteUtterancesCommand"; export * from "./commands/GetBotCommand"; export * from "./commands/GetBotAliasCommand"; export * from "./commands/GetBotAliasesCommand"; +export * from "./pagination/GetBotAliasesPaginator"; export * from "./commands/GetBotChannelAssociationCommand"; export * from "./commands/GetBotChannelAssociationsCommand"; +export * from "./pagination/GetBotChannelAssociationsPaginator"; export * from "./commands/GetBotsCommand"; +export * from "./pagination/GetBotsPaginator"; export * from "./commands/GetBotVersionsCommand"; +export * from "./pagination/GetBotVersionsPaginator"; export * from "./commands/GetBuiltinIntentCommand"; export * from "./commands/GetBuiltinIntentsCommand"; +export * from "./pagination/GetBuiltinIntentsPaginator"; export * from "./commands/GetBuiltinSlotTypesCommand"; +export * from "./pagination/GetBuiltinSlotTypesPaginator"; export * from "./commands/GetExportCommand"; export * from "./commands/GetImportCommand"; export * from "./commands/GetIntentCommand"; export * from "./commands/GetIntentsCommand"; +export * from "./pagination/GetIntentsPaginator"; export * from "./commands/GetIntentVersionsCommand"; +export * from "./pagination/GetIntentVersionsPaginator"; export * from "./commands/GetSlotTypeCommand"; export * from "./commands/GetSlotTypesCommand"; +export * from "./pagination/GetSlotTypesPaginator"; export * from "./commands/GetSlotTypeVersionsCommand"; +export * from "./pagination/GetSlotTypeVersionsPaginator"; export * from "./commands/GetUtterancesViewCommand"; export * from "./commands/ListTagsForResourceCommand"; export * from "./commands/PutBotCommand"; @@ -39,4 +49,5 @@ export * from "./commands/PutSlotTypeCommand"; export * from "./commands/StartImportCommand"; export * from "./commands/TagResourceCommand"; export * from "./commands/UntagResourceCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-lex-model-building-service/pagination/GetBotAliasesPaginator.ts b/clients/client-lex-model-building-service/pagination/GetBotAliasesPaginator.ts new file mode 100644 index 0000000000000..ce5413b5d637f --- /dev/null +++ b/clients/client-lex-model-building-service/pagination/GetBotAliasesPaginator.ts @@ -0,0 +1,51 @@ +import { LexModelBuildingService } from "../LexModelBuildingService"; +import { LexModelBuildingServiceClient } from "../LexModelBuildingServiceClient"; +import { + GetBotAliasesCommand, + GetBotAliasesCommandInput, + GetBotAliasesCommandOutput, +} from "../commands/GetBotAliasesCommand"; +import { LexModelBuildingServicePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: LexModelBuildingServiceClient, + input: GetBotAliasesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetBotAliasesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: LexModelBuildingService, + input: GetBotAliasesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getBotAliases(input, ...args); +}; +export async function* getBotAliasesPaginate( + config: LexModelBuildingServicePaginationConfiguration, + input: GetBotAliasesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetBotAliasesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof LexModelBuildingService) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof LexModelBuildingServiceClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected LexModelBuildingService | LexModelBuildingServiceClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-lex-model-building-service/pagination/GetBotChannelAssociationsPaginator.ts b/clients/client-lex-model-building-service/pagination/GetBotChannelAssociationsPaginator.ts new file mode 100644 index 0000000000000..e67b6f3867a6d --- /dev/null +++ b/clients/client-lex-model-building-service/pagination/GetBotChannelAssociationsPaginator.ts @@ -0,0 +1,51 @@ +import { LexModelBuildingService } from "../LexModelBuildingService"; +import { LexModelBuildingServiceClient } from "../LexModelBuildingServiceClient"; +import { + GetBotChannelAssociationsCommand, + GetBotChannelAssociationsCommandInput, + GetBotChannelAssociationsCommandOutput, +} from "../commands/GetBotChannelAssociationsCommand"; +import { LexModelBuildingServicePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: LexModelBuildingServiceClient, + input: GetBotChannelAssociationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetBotChannelAssociationsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: LexModelBuildingService, + input: GetBotChannelAssociationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getBotChannelAssociations(input, ...args); +}; +export async function* getBotChannelAssociationsPaginate( + config: LexModelBuildingServicePaginationConfiguration, + input: GetBotChannelAssociationsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetBotChannelAssociationsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof LexModelBuildingService) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof LexModelBuildingServiceClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected LexModelBuildingService | LexModelBuildingServiceClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-lex-model-building-service/pagination/GetBotVersionsPaginator.ts b/clients/client-lex-model-building-service/pagination/GetBotVersionsPaginator.ts new file mode 100644 index 0000000000000..d5967aab294a9 --- /dev/null +++ b/clients/client-lex-model-building-service/pagination/GetBotVersionsPaginator.ts @@ -0,0 +1,51 @@ +import { LexModelBuildingService } from "../LexModelBuildingService"; +import { LexModelBuildingServiceClient } from "../LexModelBuildingServiceClient"; +import { + GetBotVersionsCommand, + GetBotVersionsCommandInput, + GetBotVersionsCommandOutput, +} from "../commands/GetBotVersionsCommand"; +import { LexModelBuildingServicePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: LexModelBuildingServiceClient, + input: GetBotVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetBotVersionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: LexModelBuildingService, + input: GetBotVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getBotVersions(input, ...args); +}; +export async function* getBotVersionsPaginate( + config: LexModelBuildingServicePaginationConfiguration, + input: GetBotVersionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetBotVersionsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof LexModelBuildingService) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof LexModelBuildingServiceClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected LexModelBuildingService | LexModelBuildingServiceClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-lex-model-building-service/pagination/GetBotsPaginator.ts b/clients/client-lex-model-building-service/pagination/GetBotsPaginator.ts new file mode 100644 index 0000000000000..40b79f3151d09 --- /dev/null +++ b/clients/client-lex-model-building-service/pagination/GetBotsPaginator.ts @@ -0,0 +1,47 @@ +import { LexModelBuildingService } from "../LexModelBuildingService"; +import { LexModelBuildingServiceClient } from "../LexModelBuildingServiceClient"; +import { GetBotsCommand, GetBotsCommandInput, GetBotsCommandOutput } from "../commands/GetBotsCommand"; +import { LexModelBuildingServicePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: LexModelBuildingServiceClient, + input: GetBotsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetBotsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: LexModelBuildingService, + input: GetBotsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getBots(input, ...args); +}; +export async function* getBotsPaginate( + config: LexModelBuildingServicePaginationConfiguration, + input: GetBotsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetBotsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof LexModelBuildingService) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof LexModelBuildingServiceClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected LexModelBuildingService | LexModelBuildingServiceClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-lex-model-building-service/pagination/GetBuiltinIntentsPaginator.ts b/clients/client-lex-model-building-service/pagination/GetBuiltinIntentsPaginator.ts new file mode 100644 index 0000000000000..246a587d743b8 --- /dev/null +++ b/clients/client-lex-model-building-service/pagination/GetBuiltinIntentsPaginator.ts @@ -0,0 +1,51 @@ +import { LexModelBuildingService } from "../LexModelBuildingService"; +import { LexModelBuildingServiceClient } from "../LexModelBuildingServiceClient"; +import { + GetBuiltinIntentsCommand, + GetBuiltinIntentsCommandInput, + GetBuiltinIntentsCommandOutput, +} from "../commands/GetBuiltinIntentsCommand"; +import { LexModelBuildingServicePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: LexModelBuildingServiceClient, + input: GetBuiltinIntentsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetBuiltinIntentsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: LexModelBuildingService, + input: GetBuiltinIntentsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getBuiltinIntents(input, ...args); +}; +export async function* getBuiltinIntentsPaginate( + config: LexModelBuildingServicePaginationConfiguration, + input: GetBuiltinIntentsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetBuiltinIntentsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof LexModelBuildingService) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof LexModelBuildingServiceClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected LexModelBuildingService | LexModelBuildingServiceClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-lex-model-building-service/pagination/GetBuiltinSlotTypesPaginator.ts b/clients/client-lex-model-building-service/pagination/GetBuiltinSlotTypesPaginator.ts new file mode 100644 index 0000000000000..4d6181e2925f3 --- /dev/null +++ b/clients/client-lex-model-building-service/pagination/GetBuiltinSlotTypesPaginator.ts @@ -0,0 +1,51 @@ +import { LexModelBuildingService } from "../LexModelBuildingService"; +import { LexModelBuildingServiceClient } from "../LexModelBuildingServiceClient"; +import { + GetBuiltinSlotTypesCommand, + GetBuiltinSlotTypesCommandInput, + GetBuiltinSlotTypesCommandOutput, +} from "../commands/GetBuiltinSlotTypesCommand"; +import { LexModelBuildingServicePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: LexModelBuildingServiceClient, + input: GetBuiltinSlotTypesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetBuiltinSlotTypesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: LexModelBuildingService, + input: GetBuiltinSlotTypesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getBuiltinSlotTypes(input, ...args); +}; +export async function* getBuiltinSlotTypesPaginate( + config: LexModelBuildingServicePaginationConfiguration, + input: GetBuiltinSlotTypesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetBuiltinSlotTypesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof LexModelBuildingService) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof LexModelBuildingServiceClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected LexModelBuildingService | LexModelBuildingServiceClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-lex-model-building-service/pagination/GetIntentVersionsPaginator.ts b/clients/client-lex-model-building-service/pagination/GetIntentVersionsPaginator.ts new file mode 100644 index 0000000000000..53d31f19875af --- /dev/null +++ b/clients/client-lex-model-building-service/pagination/GetIntentVersionsPaginator.ts @@ -0,0 +1,51 @@ +import { LexModelBuildingService } from "../LexModelBuildingService"; +import { LexModelBuildingServiceClient } from "../LexModelBuildingServiceClient"; +import { + GetIntentVersionsCommand, + GetIntentVersionsCommandInput, + GetIntentVersionsCommandOutput, +} from "../commands/GetIntentVersionsCommand"; +import { LexModelBuildingServicePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: LexModelBuildingServiceClient, + input: GetIntentVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetIntentVersionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: LexModelBuildingService, + input: GetIntentVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getIntentVersions(input, ...args); +}; +export async function* getIntentVersionsPaginate( + config: LexModelBuildingServicePaginationConfiguration, + input: GetIntentVersionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetIntentVersionsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof LexModelBuildingService) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof LexModelBuildingServiceClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected LexModelBuildingService | LexModelBuildingServiceClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-lex-model-building-service/pagination/GetIntentsPaginator.ts b/clients/client-lex-model-building-service/pagination/GetIntentsPaginator.ts new file mode 100644 index 0000000000000..ce371114378ae --- /dev/null +++ b/clients/client-lex-model-building-service/pagination/GetIntentsPaginator.ts @@ -0,0 +1,47 @@ +import { LexModelBuildingService } from "../LexModelBuildingService"; +import { LexModelBuildingServiceClient } from "../LexModelBuildingServiceClient"; +import { GetIntentsCommand, GetIntentsCommandInput, GetIntentsCommandOutput } from "../commands/GetIntentsCommand"; +import { LexModelBuildingServicePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: LexModelBuildingServiceClient, + input: GetIntentsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetIntentsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: LexModelBuildingService, + input: GetIntentsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getIntents(input, ...args); +}; +export async function* getIntentsPaginate( + config: LexModelBuildingServicePaginationConfiguration, + input: GetIntentsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetIntentsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof LexModelBuildingService) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof LexModelBuildingServiceClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected LexModelBuildingService | LexModelBuildingServiceClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-lex-model-building-service/pagination/GetSlotTypeVersionsPaginator.ts b/clients/client-lex-model-building-service/pagination/GetSlotTypeVersionsPaginator.ts new file mode 100644 index 0000000000000..e04d2aed560ee --- /dev/null +++ b/clients/client-lex-model-building-service/pagination/GetSlotTypeVersionsPaginator.ts @@ -0,0 +1,51 @@ +import { LexModelBuildingService } from "../LexModelBuildingService"; +import { LexModelBuildingServiceClient } from "../LexModelBuildingServiceClient"; +import { + GetSlotTypeVersionsCommand, + GetSlotTypeVersionsCommandInput, + GetSlotTypeVersionsCommandOutput, +} from "../commands/GetSlotTypeVersionsCommand"; +import { LexModelBuildingServicePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: LexModelBuildingServiceClient, + input: GetSlotTypeVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetSlotTypeVersionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: LexModelBuildingService, + input: GetSlotTypeVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getSlotTypeVersions(input, ...args); +}; +export async function* getSlotTypeVersionsPaginate( + config: LexModelBuildingServicePaginationConfiguration, + input: GetSlotTypeVersionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetSlotTypeVersionsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof LexModelBuildingService) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof LexModelBuildingServiceClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected LexModelBuildingService | LexModelBuildingServiceClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-lex-model-building-service/pagination/GetSlotTypesPaginator.ts b/clients/client-lex-model-building-service/pagination/GetSlotTypesPaginator.ts new file mode 100644 index 0000000000000..2024ba69a73df --- /dev/null +++ b/clients/client-lex-model-building-service/pagination/GetSlotTypesPaginator.ts @@ -0,0 +1,51 @@ +import { LexModelBuildingService } from "../LexModelBuildingService"; +import { LexModelBuildingServiceClient } from "../LexModelBuildingServiceClient"; +import { + GetSlotTypesCommand, + GetSlotTypesCommandInput, + GetSlotTypesCommandOutput, +} from "../commands/GetSlotTypesCommand"; +import { LexModelBuildingServicePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: LexModelBuildingServiceClient, + input: GetSlotTypesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetSlotTypesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: LexModelBuildingService, + input: GetSlotTypesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getSlotTypes(input, ...args); +}; +export async function* getSlotTypesPaginate( + config: LexModelBuildingServicePaginationConfiguration, + input: GetSlotTypesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetSlotTypesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof LexModelBuildingService) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof LexModelBuildingServiceClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected LexModelBuildingService | LexModelBuildingServiceClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-lex-model-building-service/pagination/Interfaces.ts b/clients/client-lex-model-building-service/pagination/Interfaces.ts new file mode 100644 index 0000000000000..097a299adaa3a --- /dev/null +++ b/clients/client-lex-model-building-service/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { LexModelBuildingService } from "../LexModelBuildingService"; +import { LexModelBuildingServiceClient } from "../LexModelBuildingServiceClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface LexModelBuildingServicePaginationConfiguration extends PaginationConfiguration { + client: LexModelBuildingService | LexModelBuildingServiceClient; +} diff --git a/clients/client-machine-learning/index.ts b/clients/client-machine-learning/index.ts index d953b724e4469..967530297ddee 100644 --- a/clients/client-machine-learning/index.ts +++ b/clients/client-machine-learning/index.ts @@ -15,9 +15,13 @@ export * from "./commands/DeleteMLModelCommand"; export * from "./commands/DeleteRealtimeEndpointCommand"; export * from "./commands/DeleteTagsCommand"; export * from "./commands/DescribeBatchPredictionsCommand"; +export * from "./pagination/DescribeBatchPredictionsPaginator"; export * from "./commands/DescribeDataSourcesCommand"; +export * from "./pagination/DescribeDataSourcesPaginator"; export * from "./commands/DescribeEvaluationsCommand"; +export * from "./pagination/DescribeEvaluationsPaginator"; export * from "./commands/DescribeMLModelsCommand"; +export * from "./pagination/DescribeMLModelsPaginator"; export * from "./commands/DescribeTagsCommand"; export * from "./commands/GetBatchPredictionCommand"; export * from "./commands/GetDataSourceCommand"; @@ -28,4 +32,5 @@ export * from "./commands/UpdateBatchPredictionCommand"; export * from "./commands/UpdateDataSourceCommand"; export * from "./commands/UpdateEvaluationCommand"; export * from "./commands/UpdateMLModelCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-machine-learning/pagination/DescribeBatchPredictionsPaginator.ts b/clients/client-machine-learning/pagination/DescribeBatchPredictionsPaginator.ts new file mode 100644 index 0000000000000..1ca5fea094cd7 --- /dev/null +++ b/clients/client-machine-learning/pagination/DescribeBatchPredictionsPaginator.ts @@ -0,0 +1,51 @@ +import { MachineLearning } from "../MachineLearning"; +import { MachineLearningClient } from "../MachineLearningClient"; +import { + DescribeBatchPredictionsCommand, + DescribeBatchPredictionsCommandInput, + DescribeBatchPredictionsCommandOutput, +} from "../commands/DescribeBatchPredictionsCommand"; +import { MachineLearningPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: MachineLearningClient, + input: DescribeBatchPredictionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeBatchPredictionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: MachineLearning, + input: DescribeBatchPredictionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeBatchPredictions(input, ...args); +}; +export async function* describeBatchPredictionsPaginate( + config: MachineLearningPaginationConfiguration, + input: DescribeBatchPredictionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeBatchPredictionsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["Limit"] = config.pageSize; + if (config.client instanceof MachineLearning) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof MachineLearningClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected MachineLearning | MachineLearningClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-machine-learning/pagination/DescribeDataSourcesPaginator.ts b/clients/client-machine-learning/pagination/DescribeDataSourcesPaginator.ts new file mode 100644 index 0000000000000..224628af784ce --- /dev/null +++ b/clients/client-machine-learning/pagination/DescribeDataSourcesPaginator.ts @@ -0,0 +1,51 @@ +import { MachineLearning } from "../MachineLearning"; +import { MachineLearningClient } from "../MachineLearningClient"; +import { + DescribeDataSourcesCommand, + DescribeDataSourcesCommandInput, + DescribeDataSourcesCommandOutput, +} from "../commands/DescribeDataSourcesCommand"; +import { MachineLearningPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: MachineLearningClient, + input: DescribeDataSourcesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeDataSourcesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: MachineLearning, + input: DescribeDataSourcesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeDataSources(input, ...args); +}; +export async function* describeDataSourcesPaginate( + config: MachineLearningPaginationConfiguration, + input: DescribeDataSourcesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeDataSourcesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["Limit"] = config.pageSize; + if (config.client instanceof MachineLearning) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof MachineLearningClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected MachineLearning | MachineLearningClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-machine-learning/pagination/DescribeEvaluationsPaginator.ts b/clients/client-machine-learning/pagination/DescribeEvaluationsPaginator.ts new file mode 100644 index 0000000000000..703849b98c4cd --- /dev/null +++ b/clients/client-machine-learning/pagination/DescribeEvaluationsPaginator.ts @@ -0,0 +1,51 @@ +import { MachineLearning } from "../MachineLearning"; +import { MachineLearningClient } from "../MachineLearningClient"; +import { + DescribeEvaluationsCommand, + DescribeEvaluationsCommandInput, + DescribeEvaluationsCommandOutput, +} from "../commands/DescribeEvaluationsCommand"; +import { MachineLearningPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: MachineLearningClient, + input: DescribeEvaluationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeEvaluationsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: MachineLearning, + input: DescribeEvaluationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeEvaluations(input, ...args); +}; +export async function* describeEvaluationsPaginate( + config: MachineLearningPaginationConfiguration, + input: DescribeEvaluationsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeEvaluationsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["Limit"] = config.pageSize; + if (config.client instanceof MachineLearning) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof MachineLearningClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected MachineLearning | MachineLearningClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-machine-learning/pagination/DescribeMLModelsPaginator.ts b/clients/client-machine-learning/pagination/DescribeMLModelsPaginator.ts new file mode 100644 index 0000000000000..13590ccb0770c --- /dev/null +++ b/clients/client-machine-learning/pagination/DescribeMLModelsPaginator.ts @@ -0,0 +1,51 @@ +import { MachineLearning } from "../MachineLearning"; +import { MachineLearningClient } from "../MachineLearningClient"; +import { + DescribeMLModelsCommand, + DescribeMLModelsCommandInput, + DescribeMLModelsCommandOutput, +} from "../commands/DescribeMLModelsCommand"; +import { MachineLearningPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: MachineLearningClient, + input: DescribeMLModelsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeMLModelsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: MachineLearning, + input: DescribeMLModelsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeMLModels(input, ...args); +}; +export async function* describeMLModelsPaginate( + config: MachineLearningPaginationConfiguration, + input: DescribeMLModelsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeMLModelsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["Limit"] = config.pageSize; + if (config.client instanceof MachineLearning) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof MachineLearningClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected MachineLearning | MachineLearningClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-machine-learning/pagination/Interfaces.ts b/clients/client-machine-learning/pagination/Interfaces.ts new file mode 100644 index 0000000000000..f136becd46cb9 --- /dev/null +++ b/clients/client-machine-learning/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { MachineLearning } from "../MachineLearning"; +import { MachineLearningClient } from "../MachineLearningClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface MachineLearningPaginationConfiguration extends PaginationConfiguration { + client: MachineLearning | MachineLearningClient; +} diff --git a/clients/client-macie/index.ts b/clients/client-macie/index.ts index bf1186378c0fa..b48a9fe0c8767 100644 --- a/clients/client-macie/index.ts +++ b/clients/client-macie/index.ts @@ -5,6 +5,9 @@ export * from "./commands/AssociateS3ResourcesCommand"; export * from "./commands/DisassociateMemberAccountCommand"; export * from "./commands/DisassociateS3ResourcesCommand"; export * from "./commands/ListMemberAccountsCommand"; +export * from "./pagination/ListMemberAccountsPaginator"; export * from "./commands/ListS3ResourcesCommand"; +export * from "./pagination/ListS3ResourcesPaginator"; export * from "./commands/UpdateS3ResourcesCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-macie/pagination/Interfaces.ts b/clients/client-macie/pagination/Interfaces.ts new file mode 100644 index 0000000000000..0ff42cc87d887 --- /dev/null +++ b/clients/client-macie/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { Macie } from "../Macie"; +import { MacieClient } from "../MacieClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface MaciePaginationConfiguration extends PaginationConfiguration { + client: Macie | MacieClient; +} diff --git a/clients/client-macie/pagination/ListMemberAccountsPaginator.ts b/clients/client-macie/pagination/ListMemberAccountsPaginator.ts new file mode 100644 index 0000000000000..8989e699c85b2 --- /dev/null +++ b/clients/client-macie/pagination/ListMemberAccountsPaginator.ts @@ -0,0 +1,51 @@ +import { Macie } from "../Macie"; +import { MacieClient } from "../MacieClient"; +import { + ListMemberAccountsCommand, + ListMemberAccountsCommandInput, + ListMemberAccountsCommandOutput, +} from "../commands/ListMemberAccountsCommand"; +import { MaciePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: MacieClient, + input: ListMemberAccountsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListMemberAccountsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Macie, + input: ListMemberAccountsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listMemberAccounts(input, ...args); +}; +export async function* listMemberAccountsPaginate( + config: MaciePaginationConfiguration, + input: ListMemberAccountsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListMemberAccountsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof Macie) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof MacieClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Macie | MacieClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-macie/pagination/ListS3ResourcesPaginator.ts b/clients/client-macie/pagination/ListS3ResourcesPaginator.ts new file mode 100644 index 0000000000000..2b65c238bae9d --- /dev/null +++ b/clients/client-macie/pagination/ListS3ResourcesPaginator.ts @@ -0,0 +1,51 @@ +import { Macie } from "../Macie"; +import { MacieClient } from "../MacieClient"; +import { + ListS3ResourcesCommand, + ListS3ResourcesCommandInput, + ListS3ResourcesCommandOutput, +} from "../commands/ListS3ResourcesCommand"; +import { MaciePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: MacieClient, + input: ListS3ResourcesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListS3ResourcesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Macie, + input: ListS3ResourcesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listS3Resources(input, ...args); +}; +export async function* listS3ResourcesPaginate( + config: MaciePaginationConfiguration, + input: ListS3ResourcesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListS3ResourcesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof Macie) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof MacieClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Macie | MacieClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-managedblockchain/index.ts b/clients/client-managedblockchain/index.ts index ebac7f4b91e90..a1adc37e63bc5 100644 --- a/clients/client-managedblockchain/index.ts +++ b/clients/client-managedblockchain/index.ts @@ -11,13 +11,20 @@ export * from "./commands/GetNetworkCommand"; export * from "./commands/GetNodeCommand"; export * from "./commands/GetProposalCommand"; export * from "./commands/ListInvitationsCommand"; +export * from "./pagination/ListInvitationsPaginator"; export * from "./commands/ListMembersCommand"; +export * from "./pagination/ListMembersPaginator"; export * from "./commands/ListNetworksCommand"; +export * from "./pagination/ListNetworksPaginator"; export * from "./commands/ListNodesCommand"; +export * from "./pagination/ListNodesPaginator"; export * from "./commands/ListProposalsCommand"; +export * from "./pagination/ListProposalsPaginator"; export * from "./commands/ListProposalVotesCommand"; +export * from "./pagination/ListProposalVotesPaginator"; export * from "./commands/RejectInvitationCommand"; export * from "./commands/UpdateMemberCommand"; export * from "./commands/UpdateNodeCommand"; export * from "./commands/VoteOnProposalCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-managedblockchain/pagination/Interfaces.ts b/clients/client-managedblockchain/pagination/Interfaces.ts new file mode 100644 index 0000000000000..3ea9ce3c67cc7 --- /dev/null +++ b/clients/client-managedblockchain/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { ManagedBlockchain } from "../ManagedBlockchain"; +import { ManagedBlockchainClient } from "../ManagedBlockchainClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface ManagedBlockchainPaginationConfiguration extends PaginationConfiguration { + client: ManagedBlockchain | ManagedBlockchainClient; +} diff --git a/clients/client-managedblockchain/pagination/ListInvitationsPaginator.ts b/clients/client-managedblockchain/pagination/ListInvitationsPaginator.ts new file mode 100644 index 0000000000000..e24f6f7994e42 --- /dev/null +++ b/clients/client-managedblockchain/pagination/ListInvitationsPaginator.ts @@ -0,0 +1,51 @@ +import { ManagedBlockchain } from "../ManagedBlockchain"; +import { ManagedBlockchainClient } from "../ManagedBlockchainClient"; +import { + ListInvitationsCommand, + ListInvitationsCommandInput, + ListInvitationsCommandOutput, +} from "../commands/ListInvitationsCommand"; +import { ManagedBlockchainPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ManagedBlockchainClient, + input: ListInvitationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListInvitationsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ManagedBlockchain, + input: ListInvitationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listInvitations(input, ...args); +}; +export async function* listInvitationsPaginate( + config: ManagedBlockchainPaginationConfiguration, + input: ListInvitationsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListInvitationsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof ManagedBlockchain) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ManagedBlockchainClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ManagedBlockchain | ManagedBlockchainClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-managedblockchain/pagination/ListMembersPaginator.ts b/clients/client-managedblockchain/pagination/ListMembersPaginator.ts new file mode 100644 index 0000000000000..f480f8d32f91f --- /dev/null +++ b/clients/client-managedblockchain/pagination/ListMembersPaginator.ts @@ -0,0 +1,47 @@ +import { ManagedBlockchain } from "../ManagedBlockchain"; +import { ManagedBlockchainClient } from "../ManagedBlockchainClient"; +import { ListMembersCommand, ListMembersCommandInput, ListMembersCommandOutput } from "../commands/ListMembersCommand"; +import { ManagedBlockchainPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ManagedBlockchainClient, + input: ListMembersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListMembersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ManagedBlockchain, + input: ListMembersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listMembers(input, ...args); +}; +export async function* listMembersPaginate( + config: ManagedBlockchainPaginationConfiguration, + input: ListMembersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListMembersCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof ManagedBlockchain) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ManagedBlockchainClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ManagedBlockchain | ManagedBlockchainClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-managedblockchain/pagination/ListNetworksPaginator.ts b/clients/client-managedblockchain/pagination/ListNetworksPaginator.ts new file mode 100644 index 0000000000000..d1898a9d1d10f --- /dev/null +++ b/clients/client-managedblockchain/pagination/ListNetworksPaginator.ts @@ -0,0 +1,51 @@ +import { ManagedBlockchain } from "../ManagedBlockchain"; +import { ManagedBlockchainClient } from "../ManagedBlockchainClient"; +import { + ListNetworksCommand, + ListNetworksCommandInput, + ListNetworksCommandOutput, +} from "../commands/ListNetworksCommand"; +import { ManagedBlockchainPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ManagedBlockchainClient, + input: ListNetworksCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListNetworksCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ManagedBlockchain, + input: ListNetworksCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listNetworks(input, ...args); +}; +export async function* listNetworksPaginate( + config: ManagedBlockchainPaginationConfiguration, + input: ListNetworksCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListNetworksCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof ManagedBlockchain) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ManagedBlockchainClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ManagedBlockchain | ManagedBlockchainClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-managedblockchain/pagination/ListNodesPaginator.ts b/clients/client-managedblockchain/pagination/ListNodesPaginator.ts new file mode 100644 index 0000000000000..6f6735a97ebe7 --- /dev/null +++ b/clients/client-managedblockchain/pagination/ListNodesPaginator.ts @@ -0,0 +1,47 @@ +import { ManagedBlockchain } from "../ManagedBlockchain"; +import { ManagedBlockchainClient } from "../ManagedBlockchainClient"; +import { ListNodesCommand, ListNodesCommandInput, ListNodesCommandOutput } from "../commands/ListNodesCommand"; +import { ManagedBlockchainPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ManagedBlockchainClient, + input: ListNodesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListNodesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ManagedBlockchain, + input: ListNodesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listNodes(input, ...args); +}; +export async function* listNodesPaginate( + config: ManagedBlockchainPaginationConfiguration, + input: ListNodesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListNodesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof ManagedBlockchain) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ManagedBlockchainClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ManagedBlockchain | ManagedBlockchainClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-managedblockchain/pagination/ListProposalVotesPaginator.ts b/clients/client-managedblockchain/pagination/ListProposalVotesPaginator.ts new file mode 100644 index 0000000000000..fca0aac9a1b99 --- /dev/null +++ b/clients/client-managedblockchain/pagination/ListProposalVotesPaginator.ts @@ -0,0 +1,51 @@ +import { ManagedBlockchain } from "../ManagedBlockchain"; +import { ManagedBlockchainClient } from "../ManagedBlockchainClient"; +import { + ListProposalVotesCommand, + ListProposalVotesCommandInput, + ListProposalVotesCommandOutput, +} from "../commands/ListProposalVotesCommand"; +import { ManagedBlockchainPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ManagedBlockchainClient, + input: ListProposalVotesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListProposalVotesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ManagedBlockchain, + input: ListProposalVotesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listProposalVotes(input, ...args); +}; +export async function* listProposalVotesPaginate( + config: ManagedBlockchainPaginationConfiguration, + input: ListProposalVotesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListProposalVotesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof ManagedBlockchain) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ManagedBlockchainClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ManagedBlockchain | ManagedBlockchainClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-managedblockchain/pagination/ListProposalsPaginator.ts b/clients/client-managedblockchain/pagination/ListProposalsPaginator.ts new file mode 100644 index 0000000000000..8f0d6893e434f --- /dev/null +++ b/clients/client-managedblockchain/pagination/ListProposalsPaginator.ts @@ -0,0 +1,51 @@ +import { ManagedBlockchain } from "../ManagedBlockchain"; +import { ManagedBlockchainClient } from "../ManagedBlockchainClient"; +import { + ListProposalsCommand, + ListProposalsCommandInput, + ListProposalsCommandOutput, +} from "../commands/ListProposalsCommand"; +import { ManagedBlockchainPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ManagedBlockchainClient, + input: ListProposalsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListProposalsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ManagedBlockchain, + input: ListProposalsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listProposals(input, ...args); +}; +export async function* listProposalsPaginate( + config: ManagedBlockchainPaginationConfiguration, + input: ListProposalsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListProposalsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof ManagedBlockchain) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ManagedBlockchainClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ManagedBlockchain | ManagedBlockchainClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-marketplace-catalog/index.ts b/clients/client-marketplace-catalog/index.ts index bac421830aa04..e172aa4d3a311 100644 --- a/clients/client-marketplace-catalog/index.ts +++ b/clients/client-marketplace-catalog/index.ts @@ -4,6 +4,9 @@ export * from "./commands/CancelChangeSetCommand"; export * from "./commands/DescribeChangeSetCommand"; export * from "./commands/DescribeEntityCommand"; export * from "./commands/ListChangeSetsCommand"; +export * from "./pagination/ListChangeSetsPaginator"; export * from "./commands/ListEntitiesCommand"; +export * from "./pagination/ListEntitiesPaginator"; export * from "./commands/StartChangeSetCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-marketplace-catalog/pagination/Interfaces.ts b/clients/client-marketplace-catalog/pagination/Interfaces.ts new file mode 100644 index 0000000000000..8abf20fa83b39 --- /dev/null +++ b/clients/client-marketplace-catalog/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { MarketplaceCatalog } from "../MarketplaceCatalog"; +import { MarketplaceCatalogClient } from "../MarketplaceCatalogClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface MarketplaceCatalogPaginationConfiguration extends PaginationConfiguration { + client: MarketplaceCatalog | MarketplaceCatalogClient; +} diff --git a/clients/client-marketplace-catalog/pagination/ListChangeSetsPaginator.ts b/clients/client-marketplace-catalog/pagination/ListChangeSetsPaginator.ts new file mode 100644 index 0000000000000..a7c0ce51285fb --- /dev/null +++ b/clients/client-marketplace-catalog/pagination/ListChangeSetsPaginator.ts @@ -0,0 +1,51 @@ +import { MarketplaceCatalog } from "../MarketplaceCatalog"; +import { MarketplaceCatalogClient } from "../MarketplaceCatalogClient"; +import { + ListChangeSetsCommand, + ListChangeSetsCommandInput, + ListChangeSetsCommandOutput, +} from "../commands/ListChangeSetsCommand"; +import { MarketplaceCatalogPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: MarketplaceCatalogClient, + input: ListChangeSetsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListChangeSetsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: MarketplaceCatalog, + input: ListChangeSetsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listChangeSets(input, ...args); +}; +export async function* listChangeSetsPaginate( + config: MarketplaceCatalogPaginationConfiguration, + input: ListChangeSetsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListChangeSetsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof MarketplaceCatalog) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof MarketplaceCatalogClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected MarketplaceCatalog | MarketplaceCatalogClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-marketplace-catalog/pagination/ListEntitiesPaginator.ts b/clients/client-marketplace-catalog/pagination/ListEntitiesPaginator.ts new file mode 100644 index 0000000000000..4dbe78b0ebece --- /dev/null +++ b/clients/client-marketplace-catalog/pagination/ListEntitiesPaginator.ts @@ -0,0 +1,51 @@ +import { MarketplaceCatalog } from "../MarketplaceCatalog"; +import { MarketplaceCatalogClient } from "../MarketplaceCatalogClient"; +import { + ListEntitiesCommand, + ListEntitiesCommandInput, + ListEntitiesCommandOutput, +} from "../commands/ListEntitiesCommand"; +import { MarketplaceCatalogPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: MarketplaceCatalogClient, + input: ListEntitiesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListEntitiesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: MarketplaceCatalog, + input: ListEntitiesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listEntities(input, ...args); +}; +export async function* listEntitiesPaginate( + config: MarketplaceCatalogPaginationConfiguration, + input: ListEntitiesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListEntitiesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof MarketplaceCatalog) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof MarketplaceCatalogClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected MarketplaceCatalog | MarketplaceCatalogClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-mediastore/index.ts b/clients/client-mediastore/index.ts index 4f7c74589b420..6a8b7eec0f756 100644 --- a/clients/client-mediastore/index.ts +++ b/clients/client-mediastore/index.ts @@ -12,6 +12,7 @@ export * from "./commands/GetCorsPolicyCommand"; export * from "./commands/GetLifecyclePolicyCommand"; export * from "./commands/GetMetricPolicyCommand"; export * from "./commands/ListContainersCommand"; +export * from "./pagination/ListContainersPaginator"; export * from "./commands/ListTagsForResourceCommand"; export * from "./commands/PutContainerPolicyCommand"; export * from "./commands/PutCorsPolicyCommand"; @@ -21,4 +22,5 @@ export * from "./commands/StartAccessLoggingCommand"; export * from "./commands/StopAccessLoggingCommand"; export * from "./commands/TagResourceCommand"; export * from "./commands/UntagResourceCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-mediastore/pagination/Interfaces.ts b/clients/client-mediastore/pagination/Interfaces.ts new file mode 100644 index 0000000000000..db87da2c1c942 --- /dev/null +++ b/clients/client-mediastore/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { MediaStore } from "../MediaStore"; +import { MediaStoreClient } from "../MediaStoreClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface MediaStorePaginationConfiguration extends PaginationConfiguration { + client: MediaStore | MediaStoreClient; +} diff --git a/clients/client-mediastore/pagination/ListContainersPaginator.ts b/clients/client-mediastore/pagination/ListContainersPaginator.ts new file mode 100644 index 0000000000000..cd53a9e6c759e --- /dev/null +++ b/clients/client-mediastore/pagination/ListContainersPaginator.ts @@ -0,0 +1,51 @@ +import { MediaStore } from "../MediaStore"; +import { MediaStoreClient } from "../MediaStoreClient"; +import { + ListContainersCommand, + ListContainersCommandInput, + ListContainersCommandOutput, +} from "../commands/ListContainersCommand"; +import { MediaStorePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: MediaStoreClient, + input: ListContainersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListContainersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: MediaStore, + input: ListContainersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listContainers(input, ...args); +}; +export async function* listContainersPaginate( + config: MediaStorePaginationConfiguration, + input: ListContainersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListContainersCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof MediaStore) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof MediaStoreClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected MediaStore | MediaStoreClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-migration-hub/index.ts b/clients/client-migration-hub/index.ts index e9f5f81d0306b..a8499daa03e2b 100644 --- a/clients/client-migration-hub/index.ts +++ b/clients/client-migration-hub/index.ts @@ -10,11 +10,17 @@ export * from "./commands/DisassociateCreatedArtifactCommand"; export * from "./commands/DisassociateDiscoveredResourceCommand"; export * from "./commands/ImportMigrationTaskCommand"; export * from "./commands/ListApplicationStatesCommand"; +export * from "./pagination/ListApplicationStatesPaginator"; export * from "./commands/ListCreatedArtifactsCommand"; +export * from "./pagination/ListCreatedArtifactsPaginator"; export * from "./commands/ListDiscoveredResourcesCommand"; +export * from "./pagination/ListDiscoveredResourcesPaginator"; export * from "./commands/ListMigrationTasksCommand"; +export * from "./pagination/ListMigrationTasksPaginator"; export * from "./commands/ListProgressUpdateStreamsCommand"; +export * from "./pagination/ListProgressUpdateStreamsPaginator"; export * from "./commands/NotifyApplicationStateCommand"; export * from "./commands/NotifyMigrationTaskStateCommand"; export * from "./commands/PutResourceAttributesCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-migration-hub/pagination/Interfaces.ts b/clients/client-migration-hub/pagination/Interfaces.ts new file mode 100644 index 0000000000000..94f4f74a83f52 --- /dev/null +++ b/clients/client-migration-hub/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { MigrationHub } from "../MigrationHub"; +import { MigrationHubClient } from "../MigrationHubClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface MigrationHubPaginationConfiguration extends PaginationConfiguration { + client: MigrationHub | MigrationHubClient; +} diff --git a/clients/client-migration-hub/pagination/ListApplicationStatesPaginator.ts b/clients/client-migration-hub/pagination/ListApplicationStatesPaginator.ts new file mode 100644 index 0000000000000..3ac4da0172690 --- /dev/null +++ b/clients/client-migration-hub/pagination/ListApplicationStatesPaginator.ts @@ -0,0 +1,51 @@ +import { MigrationHub } from "../MigrationHub"; +import { MigrationHubClient } from "../MigrationHubClient"; +import { + ListApplicationStatesCommand, + ListApplicationStatesCommandInput, + ListApplicationStatesCommandOutput, +} from "../commands/ListApplicationStatesCommand"; +import { MigrationHubPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: MigrationHubClient, + input: ListApplicationStatesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListApplicationStatesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: MigrationHub, + input: ListApplicationStatesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listApplicationStates(input, ...args); +}; +export async function* listApplicationStatesPaginate( + config: MigrationHubPaginationConfiguration, + input: ListApplicationStatesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListApplicationStatesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof MigrationHub) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof MigrationHubClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected MigrationHub | MigrationHubClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-migration-hub/pagination/ListCreatedArtifactsPaginator.ts b/clients/client-migration-hub/pagination/ListCreatedArtifactsPaginator.ts new file mode 100644 index 0000000000000..2d6e37f0bdb46 --- /dev/null +++ b/clients/client-migration-hub/pagination/ListCreatedArtifactsPaginator.ts @@ -0,0 +1,51 @@ +import { MigrationHub } from "../MigrationHub"; +import { MigrationHubClient } from "../MigrationHubClient"; +import { + ListCreatedArtifactsCommand, + ListCreatedArtifactsCommandInput, + ListCreatedArtifactsCommandOutput, +} from "../commands/ListCreatedArtifactsCommand"; +import { MigrationHubPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: MigrationHubClient, + input: ListCreatedArtifactsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListCreatedArtifactsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: MigrationHub, + input: ListCreatedArtifactsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listCreatedArtifacts(input, ...args); +}; +export async function* listCreatedArtifactsPaginate( + config: MigrationHubPaginationConfiguration, + input: ListCreatedArtifactsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListCreatedArtifactsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof MigrationHub) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof MigrationHubClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected MigrationHub | MigrationHubClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-migration-hub/pagination/ListDiscoveredResourcesPaginator.ts b/clients/client-migration-hub/pagination/ListDiscoveredResourcesPaginator.ts new file mode 100644 index 0000000000000..daa1b944bcde7 --- /dev/null +++ b/clients/client-migration-hub/pagination/ListDiscoveredResourcesPaginator.ts @@ -0,0 +1,51 @@ +import { MigrationHub } from "../MigrationHub"; +import { MigrationHubClient } from "../MigrationHubClient"; +import { + ListDiscoveredResourcesCommand, + ListDiscoveredResourcesCommandInput, + ListDiscoveredResourcesCommandOutput, +} from "../commands/ListDiscoveredResourcesCommand"; +import { MigrationHubPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: MigrationHubClient, + input: ListDiscoveredResourcesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDiscoveredResourcesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: MigrationHub, + input: ListDiscoveredResourcesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDiscoveredResources(input, ...args); +}; +export async function* listDiscoveredResourcesPaginate( + config: MigrationHubPaginationConfiguration, + input: ListDiscoveredResourcesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDiscoveredResourcesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof MigrationHub) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof MigrationHubClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected MigrationHub | MigrationHubClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-migration-hub/pagination/ListMigrationTasksPaginator.ts b/clients/client-migration-hub/pagination/ListMigrationTasksPaginator.ts new file mode 100644 index 0000000000000..90959dc8b4e83 --- /dev/null +++ b/clients/client-migration-hub/pagination/ListMigrationTasksPaginator.ts @@ -0,0 +1,51 @@ +import { MigrationHub } from "../MigrationHub"; +import { MigrationHubClient } from "../MigrationHubClient"; +import { + ListMigrationTasksCommand, + ListMigrationTasksCommandInput, + ListMigrationTasksCommandOutput, +} from "../commands/ListMigrationTasksCommand"; +import { MigrationHubPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: MigrationHubClient, + input: ListMigrationTasksCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListMigrationTasksCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: MigrationHub, + input: ListMigrationTasksCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listMigrationTasks(input, ...args); +}; +export async function* listMigrationTasksPaginate( + config: MigrationHubPaginationConfiguration, + input: ListMigrationTasksCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListMigrationTasksCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof MigrationHub) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof MigrationHubClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected MigrationHub | MigrationHubClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-migration-hub/pagination/ListProgressUpdateStreamsPaginator.ts b/clients/client-migration-hub/pagination/ListProgressUpdateStreamsPaginator.ts new file mode 100644 index 0000000000000..7a6d687d9d221 --- /dev/null +++ b/clients/client-migration-hub/pagination/ListProgressUpdateStreamsPaginator.ts @@ -0,0 +1,51 @@ +import { MigrationHub } from "../MigrationHub"; +import { MigrationHubClient } from "../MigrationHubClient"; +import { + ListProgressUpdateStreamsCommand, + ListProgressUpdateStreamsCommandInput, + ListProgressUpdateStreamsCommandOutput, +} from "../commands/ListProgressUpdateStreamsCommand"; +import { MigrationHubPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: MigrationHubClient, + input: ListProgressUpdateStreamsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListProgressUpdateStreamsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: MigrationHub, + input: ListProgressUpdateStreamsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listProgressUpdateStreams(input, ...args); +}; +export async function* listProgressUpdateStreamsPaginate( + config: MigrationHubPaginationConfiguration, + input: ListProgressUpdateStreamsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListProgressUpdateStreamsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof MigrationHub) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof MigrationHubClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected MigrationHub | MigrationHubClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-migrationhub-config/index.ts b/clients/client-migrationhub-config/index.ts index 06189eb23df8f..419dce78accad 100644 --- a/clients/client-migrationhub-config/index.ts +++ b/clients/client-migrationhub-config/index.ts @@ -2,5 +2,7 @@ export * from "./MigrationHubConfigClient"; export * from "./MigrationHubConfig"; export * from "./commands/CreateHomeRegionControlCommand"; export * from "./commands/DescribeHomeRegionControlsCommand"; +export * from "./pagination/DescribeHomeRegionControlsPaginator"; export * from "./commands/GetHomeRegionCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-migrationhub-config/pagination/DescribeHomeRegionControlsPaginator.ts b/clients/client-migrationhub-config/pagination/DescribeHomeRegionControlsPaginator.ts new file mode 100644 index 0000000000000..268d5bc4e6230 --- /dev/null +++ b/clients/client-migrationhub-config/pagination/DescribeHomeRegionControlsPaginator.ts @@ -0,0 +1,51 @@ +import { MigrationHubConfig } from "../MigrationHubConfig"; +import { MigrationHubConfigClient } from "../MigrationHubConfigClient"; +import { + DescribeHomeRegionControlsCommand, + DescribeHomeRegionControlsCommandInput, + DescribeHomeRegionControlsCommandOutput, +} from "../commands/DescribeHomeRegionControlsCommand"; +import { MigrationHubConfigPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: MigrationHubConfigClient, + input: DescribeHomeRegionControlsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeHomeRegionControlsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: MigrationHubConfig, + input: DescribeHomeRegionControlsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeHomeRegionControls(input, ...args); +}; +export async function* describeHomeRegionControlsPaginate( + config: MigrationHubConfigPaginationConfiguration, + input: DescribeHomeRegionControlsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeHomeRegionControlsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof MigrationHubConfig) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof MigrationHubConfigClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected MigrationHubConfig | MigrationHubConfigClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-migrationhub-config/pagination/Interfaces.ts b/clients/client-migrationhub-config/pagination/Interfaces.ts new file mode 100644 index 0000000000000..95222a50d1c8e --- /dev/null +++ b/clients/client-migrationhub-config/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { MigrationHubConfig } from "../MigrationHubConfig"; +import { MigrationHubConfigClient } from "../MigrationHubConfigClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface MigrationHubConfigPaginationConfiguration extends PaginationConfiguration { + client: MigrationHubConfig | MigrationHubConfigClient; +} diff --git a/clients/client-mobile/index.ts b/clients/client-mobile/index.ts index 85047fa565a5c..d5825a694e466 100644 --- a/clients/client-mobile/index.ts +++ b/clients/client-mobile/index.ts @@ -7,6 +7,9 @@ export * from "./commands/DescribeProjectCommand"; export * from "./commands/ExportBundleCommand"; export * from "./commands/ExportProjectCommand"; export * from "./commands/ListBundlesCommand"; +export * from "./pagination/ListBundlesPaginator"; export * from "./commands/ListProjectsCommand"; +export * from "./pagination/ListProjectsPaginator"; export * from "./commands/UpdateProjectCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-mobile/pagination/Interfaces.ts b/clients/client-mobile/pagination/Interfaces.ts new file mode 100644 index 0000000000000..933b74e673e44 --- /dev/null +++ b/clients/client-mobile/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { Mobile } from "../Mobile"; +import { MobileClient } from "../MobileClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface MobilePaginationConfiguration extends PaginationConfiguration { + client: Mobile | MobileClient; +} diff --git a/clients/client-mobile/pagination/ListBundlesPaginator.ts b/clients/client-mobile/pagination/ListBundlesPaginator.ts new file mode 100644 index 0000000000000..97ad2e1bf46b9 --- /dev/null +++ b/clients/client-mobile/pagination/ListBundlesPaginator.ts @@ -0,0 +1,47 @@ +import { Mobile } from "../Mobile"; +import { MobileClient } from "../MobileClient"; +import { ListBundlesCommand, ListBundlesCommandInput, ListBundlesCommandOutput } from "../commands/ListBundlesCommand"; +import { MobilePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: MobileClient, + input: ListBundlesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListBundlesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Mobile, + input: ListBundlesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listBundles(input, ...args); +}; +export async function* listBundlesPaginate( + config: MobilePaginationConfiguration, + input: ListBundlesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListBundlesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof Mobile) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof MobileClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Mobile | MobileClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-mobile/pagination/ListProjectsPaginator.ts b/clients/client-mobile/pagination/ListProjectsPaginator.ts new file mode 100644 index 0000000000000..e395795404dd2 --- /dev/null +++ b/clients/client-mobile/pagination/ListProjectsPaginator.ts @@ -0,0 +1,51 @@ +import { Mobile } from "../Mobile"; +import { MobileClient } from "../MobileClient"; +import { + ListProjectsCommand, + ListProjectsCommandInput, + ListProjectsCommandOutput, +} from "../commands/ListProjectsCommand"; +import { MobilePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: MobileClient, + input: ListProjectsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListProjectsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Mobile, + input: ListProjectsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listProjects(input, ...args); +}; +export async function* listProjectsPaginate( + config: MobilePaginationConfiguration, + input: ListProjectsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListProjectsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof Mobile) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof MobileClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Mobile | MobileClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-mturk/index.ts b/clients/client-mturk/index.ts index f89f8e3634b51..ba28c4aa8af3d 100644 --- a/clients/client-mturk/index.ts +++ b/clients/client-mturk/index.ts @@ -20,15 +20,25 @@ export * from "./commands/GetHITCommand"; export * from "./commands/GetQualificationScoreCommand"; export * from "./commands/GetQualificationTypeCommand"; export * from "./commands/ListAssignmentsForHITCommand"; +export * from "./pagination/ListAssignmentsForHITPaginator"; export * from "./commands/ListBonusPaymentsCommand"; +export * from "./pagination/ListBonusPaymentsPaginator"; export * from "./commands/ListHITsCommand"; +export * from "./pagination/ListHITsPaginator"; export * from "./commands/ListHITsForQualificationTypeCommand"; +export * from "./pagination/ListHITsForQualificationTypePaginator"; export * from "./commands/ListQualificationRequestsCommand"; +export * from "./pagination/ListQualificationRequestsPaginator"; export * from "./commands/ListQualificationTypesCommand"; +export * from "./pagination/ListQualificationTypesPaginator"; export * from "./commands/ListReviewableHITsCommand"; +export * from "./pagination/ListReviewableHITsPaginator"; export * from "./commands/ListReviewPolicyResultsForHITCommand"; +export * from "./pagination/ListReviewPolicyResultsForHITPaginator"; export * from "./commands/ListWorkerBlocksCommand"; +export * from "./pagination/ListWorkerBlocksPaginator"; export * from "./commands/ListWorkersWithQualificationTypeCommand"; +export * from "./pagination/ListWorkersWithQualificationTypePaginator"; export * from "./commands/NotifyWorkersCommand"; export * from "./commands/RejectAssignmentCommand"; export * from "./commands/RejectQualificationRequestCommand"; @@ -39,4 +49,5 @@ export * from "./commands/UpdateHITReviewStatusCommand"; export * from "./commands/UpdateHITTypeOfHITCommand"; export * from "./commands/UpdateNotificationSettingsCommand"; export * from "./commands/UpdateQualificationTypeCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-mturk/pagination/Interfaces.ts b/clients/client-mturk/pagination/Interfaces.ts new file mode 100644 index 0000000000000..17ccf51780ffc --- /dev/null +++ b/clients/client-mturk/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { MTurk } from "../MTurk"; +import { MTurkClient } from "../MTurkClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface MTurkPaginationConfiguration extends PaginationConfiguration { + client: MTurk | MTurkClient; +} diff --git a/clients/client-mturk/pagination/ListAssignmentsForHITPaginator.ts b/clients/client-mturk/pagination/ListAssignmentsForHITPaginator.ts new file mode 100644 index 0000000000000..335011589abb9 --- /dev/null +++ b/clients/client-mturk/pagination/ListAssignmentsForHITPaginator.ts @@ -0,0 +1,51 @@ +import { MTurk } from "../MTurk"; +import { MTurkClient } from "../MTurkClient"; +import { + ListAssignmentsForHITCommand, + ListAssignmentsForHITCommandInput, + ListAssignmentsForHITCommandOutput, +} from "../commands/ListAssignmentsForHITCommand"; +import { MTurkPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: MTurkClient, + input: ListAssignmentsForHITCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListAssignmentsForHITCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: MTurk, + input: ListAssignmentsForHITCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listAssignmentsForHIT(input, ...args); +}; +export async function* listAssignmentsForHITPaginate( + config: MTurkPaginationConfiguration, + input: ListAssignmentsForHITCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListAssignmentsForHITCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof MTurk) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof MTurkClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected MTurk | MTurkClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-mturk/pagination/ListBonusPaymentsPaginator.ts b/clients/client-mturk/pagination/ListBonusPaymentsPaginator.ts new file mode 100644 index 0000000000000..48d5ca48e9eb3 --- /dev/null +++ b/clients/client-mturk/pagination/ListBonusPaymentsPaginator.ts @@ -0,0 +1,51 @@ +import { MTurk } from "../MTurk"; +import { MTurkClient } from "../MTurkClient"; +import { + ListBonusPaymentsCommand, + ListBonusPaymentsCommandInput, + ListBonusPaymentsCommandOutput, +} from "../commands/ListBonusPaymentsCommand"; +import { MTurkPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: MTurkClient, + input: ListBonusPaymentsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListBonusPaymentsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: MTurk, + input: ListBonusPaymentsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listBonusPayments(input, ...args); +}; +export async function* listBonusPaymentsPaginate( + config: MTurkPaginationConfiguration, + input: ListBonusPaymentsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListBonusPaymentsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof MTurk) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof MTurkClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected MTurk | MTurkClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-mturk/pagination/ListHITsForQualificationTypePaginator.ts b/clients/client-mturk/pagination/ListHITsForQualificationTypePaginator.ts new file mode 100644 index 0000000000000..6697347153772 --- /dev/null +++ b/clients/client-mturk/pagination/ListHITsForQualificationTypePaginator.ts @@ -0,0 +1,51 @@ +import { MTurk } from "../MTurk"; +import { MTurkClient } from "../MTurkClient"; +import { + ListHITsForQualificationTypeCommand, + ListHITsForQualificationTypeCommandInput, + ListHITsForQualificationTypeCommandOutput, +} from "../commands/ListHITsForQualificationTypeCommand"; +import { MTurkPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: MTurkClient, + input: ListHITsForQualificationTypeCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListHITsForQualificationTypeCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: MTurk, + input: ListHITsForQualificationTypeCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listHITsForQualificationType(input, ...args); +}; +export async function* listHITsForQualificationTypePaginate( + config: MTurkPaginationConfiguration, + input: ListHITsForQualificationTypeCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListHITsForQualificationTypeCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof MTurk) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof MTurkClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected MTurk | MTurkClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-mturk/pagination/ListHITsPaginator.ts b/clients/client-mturk/pagination/ListHITsPaginator.ts new file mode 100644 index 0000000000000..6e181752fc045 --- /dev/null +++ b/clients/client-mturk/pagination/ListHITsPaginator.ts @@ -0,0 +1,47 @@ +import { MTurk } from "../MTurk"; +import { MTurkClient } from "../MTurkClient"; +import { ListHITsCommand, ListHITsCommandInput, ListHITsCommandOutput } from "../commands/ListHITsCommand"; +import { MTurkPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: MTurkClient, + input: ListHITsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListHITsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: MTurk, + input: ListHITsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listHITs(input, ...args); +}; +export async function* listHITsPaginate( + config: MTurkPaginationConfiguration, + input: ListHITsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListHITsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof MTurk) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof MTurkClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected MTurk | MTurkClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-mturk/pagination/ListQualificationRequestsPaginator.ts b/clients/client-mturk/pagination/ListQualificationRequestsPaginator.ts new file mode 100644 index 0000000000000..3a5b01b1af9e5 --- /dev/null +++ b/clients/client-mturk/pagination/ListQualificationRequestsPaginator.ts @@ -0,0 +1,51 @@ +import { MTurk } from "../MTurk"; +import { MTurkClient } from "../MTurkClient"; +import { + ListQualificationRequestsCommand, + ListQualificationRequestsCommandInput, + ListQualificationRequestsCommandOutput, +} from "../commands/ListQualificationRequestsCommand"; +import { MTurkPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: MTurkClient, + input: ListQualificationRequestsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListQualificationRequestsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: MTurk, + input: ListQualificationRequestsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listQualificationRequests(input, ...args); +}; +export async function* listQualificationRequestsPaginate( + config: MTurkPaginationConfiguration, + input: ListQualificationRequestsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListQualificationRequestsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof MTurk) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof MTurkClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected MTurk | MTurkClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-mturk/pagination/ListQualificationTypesPaginator.ts b/clients/client-mturk/pagination/ListQualificationTypesPaginator.ts new file mode 100644 index 0000000000000..e7f4acdbf89ea --- /dev/null +++ b/clients/client-mturk/pagination/ListQualificationTypesPaginator.ts @@ -0,0 +1,51 @@ +import { MTurk } from "../MTurk"; +import { MTurkClient } from "../MTurkClient"; +import { + ListQualificationTypesCommand, + ListQualificationTypesCommandInput, + ListQualificationTypesCommandOutput, +} from "../commands/ListQualificationTypesCommand"; +import { MTurkPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: MTurkClient, + input: ListQualificationTypesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListQualificationTypesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: MTurk, + input: ListQualificationTypesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listQualificationTypes(input, ...args); +}; +export async function* listQualificationTypesPaginate( + config: MTurkPaginationConfiguration, + input: ListQualificationTypesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListQualificationTypesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof MTurk) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof MTurkClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected MTurk | MTurkClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-mturk/pagination/ListReviewPolicyResultsForHITPaginator.ts b/clients/client-mturk/pagination/ListReviewPolicyResultsForHITPaginator.ts new file mode 100644 index 0000000000000..1048d67c21257 --- /dev/null +++ b/clients/client-mturk/pagination/ListReviewPolicyResultsForHITPaginator.ts @@ -0,0 +1,51 @@ +import { MTurk } from "../MTurk"; +import { MTurkClient } from "../MTurkClient"; +import { + ListReviewPolicyResultsForHITCommand, + ListReviewPolicyResultsForHITCommandInput, + ListReviewPolicyResultsForHITCommandOutput, +} from "../commands/ListReviewPolicyResultsForHITCommand"; +import { MTurkPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: MTurkClient, + input: ListReviewPolicyResultsForHITCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListReviewPolicyResultsForHITCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: MTurk, + input: ListReviewPolicyResultsForHITCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listReviewPolicyResultsForHIT(input, ...args); +}; +export async function* listReviewPolicyResultsForHITPaginate( + config: MTurkPaginationConfiguration, + input: ListReviewPolicyResultsForHITCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListReviewPolicyResultsForHITCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof MTurk) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof MTurkClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected MTurk | MTurkClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-mturk/pagination/ListReviewableHITsPaginator.ts b/clients/client-mturk/pagination/ListReviewableHITsPaginator.ts new file mode 100644 index 0000000000000..86ddd3ae44e3e --- /dev/null +++ b/clients/client-mturk/pagination/ListReviewableHITsPaginator.ts @@ -0,0 +1,51 @@ +import { MTurk } from "../MTurk"; +import { MTurkClient } from "../MTurkClient"; +import { + ListReviewableHITsCommand, + ListReviewableHITsCommandInput, + ListReviewableHITsCommandOutput, +} from "../commands/ListReviewableHITsCommand"; +import { MTurkPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: MTurkClient, + input: ListReviewableHITsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListReviewableHITsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: MTurk, + input: ListReviewableHITsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listReviewableHITs(input, ...args); +}; +export async function* listReviewableHITsPaginate( + config: MTurkPaginationConfiguration, + input: ListReviewableHITsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListReviewableHITsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof MTurk) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof MTurkClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected MTurk | MTurkClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-mturk/pagination/ListWorkerBlocksPaginator.ts b/clients/client-mturk/pagination/ListWorkerBlocksPaginator.ts new file mode 100644 index 0000000000000..c9abb957feb5e --- /dev/null +++ b/clients/client-mturk/pagination/ListWorkerBlocksPaginator.ts @@ -0,0 +1,51 @@ +import { MTurk } from "../MTurk"; +import { MTurkClient } from "../MTurkClient"; +import { + ListWorkerBlocksCommand, + ListWorkerBlocksCommandInput, + ListWorkerBlocksCommandOutput, +} from "../commands/ListWorkerBlocksCommand"; +import { MTurkPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: MTurkClient, + input: ListWorkerBlocksCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListWorkerBlocksCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: MTurk, + input: ListWorkerBlocksCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listWorkerBlocks(input, ...args); +}; +export async function* listWorkerBlocksPaginate( + config: MTurkPaginationConfiguration, + input: ListWorkerBlocksCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListWorkerBlocksCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof MTurk) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof MTurkClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected MTurk | MTurkClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-mturk/pagination/ListWorkersWithQualificationTypePaginator.ts b/clients/client-mturk/pagination/ListWorkersWithQualificationTypePaginator.ts new file mode 100644 index 0000000000000..95f3fa37295e6 --- /dev/null +++ b/clients/client-mturk/pagination/ListWorkersWithQualificationTypePaginator.ts @@ -0,0 +1,51 @@ +import { MTurk } from "../MTurk"; +import { MTurkClient } from "../MTurkClient"; +import { + ListWorkersWithQualificationTypeCommand, + ListWorkersWithQualificationTypeCommandInput, + ListWorkersWithQualificationTypeCommandOutput, +} from "../commands/ListWorkersWithQualificationTypeCommand"; +import { MTurkPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: MTurkClient, + input: ListWorkersWithQualificationTypeCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListWorkersWithQualificationTypeCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: MTurk, + input: ListWorkersWithQualificationTypeCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listWorkersWithQualificationType(input, ...args); +}; +export async function* listWorkersWithQualificationTypePaginate( + config: MTurkPaginationConfiguration, + input: ListWorkersWithQualificationTypeCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListWorkersWithQualificationTypeCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof MTurk) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof MTurkClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected MTurk | MTurkClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-neptune/index.ts b/clients/client-neptune/index.ts index 035b0a0148a84..be565ec5e5bc2 100644 --- a/clients/client-neptune/index.ts +++ b/clients/client-neptune/index.ts @@ -27,16 +27,24 @@ export * from "./commands/DescribeDBClustersCommand"; export * from "./commands/DescribeDBClusterSnapshotAttributesCommand"; export * from "./commands/DescribeDBClusterSnapshotsCommand"; export * from "./commands/DescribeDBEngineVersionsCommand"; +export * from "./pagination/DescribeDBEngineVersionsPaginator"; export * from "./commands/DescribeDBInstancesCommand"; +export * from "./pagination/DescribeDBInstancesPaginator"; export * from "./commands/DescribeDBParameterGroupsCommand"; +export * from "./pagination/DescribeDBParameterGroupsPaginator"; export * from "./commands/DescribeDBParametersCommand"; +export * from "./pagination/DescribeDBParametersPaginator"; export * from "./commands/DescribeDBSubnetGroupsCommand"; +export * from "./pagination/DescribeDBSubnetGroupsPaginator"; export * from "./commands/DescribeEngineDefaultClusterParametersCommand"; export * from "./commands/DescribeEngineDefaultParametersCommand"; export * from "./commands/DescribeEventCategoriesCommand"; export * from "./commands/DescribeEventsCommand"; +export * from "./pagination/DescribeEventsPaginator"; export * from "./commands/DescribeEventSubscriptionsCommand"; +export * from "./pagination/DescribeEventSubscriptionsPaginator"; export * from "./commands/DescribeOrderableDBInstanceOptionsCommand"; +export * from "./pagination/DescribeOrderableDBInstanceOptionsPaginator"; export * from "./commands/DescribePendingMaintenanceActionsCommand"; export * from "./commands/DescribeValidDBInstanceModificationsCommand"; export * from "./commands/FailoverDBClusterCommand"; @@ -59,4 +67,5 @@ export * from "./commands/RestoreDBClusterFromSnapshotCommand"; export * from "./commands/RestoreDBClusterToPointInTimeCommand"; export * from "./commands/StartDBClusterCommand"; export * from "./commands/StopDBClusterCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-neptune/pagination/DescribeDBEngineVersionsPaginator.ts b/clients/client-neptune/pagination/DescribeDBEngineVersionsPaginator.ts new file mode 100644 index 0000000000000..f77bf9ff9bf3f --- /dev/null +++ b/clients/client-neptune/pagination/DescribeDBEngineVersionsPaginator.ts @@ -0,0 +1,51 @@ +import { Neptune } from "../Neptune"; +import { NeptuneClient } from "../NeptuneClient"; +import { + DescribeDBEngineVersionsCommand, + DescribeDBEngineVersionsCommandInput, + DescribeDBEngineVersionsCommandOutput, +} from "../commands/DescribeDBEngineVersionsCommand"; +import { NeptunePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: NeptuneClient, + input: DescribeDBEngineVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeDBEngineVersionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Neptune, + input: DescribeDBEngineVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeDBEngineVersions(input, ...args); +}; +export async function* describeDBEngineVersionsPaginate( + config: NeptunePaginationConfiguration, + input: DescribeDBEngineVersionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeDBEngineVersionsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof Neptune) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof NeptuneClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Neptune | NeptuneClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-neptune/pagination/DescribeDBInstancesPaginator.ts b/clients/client-neptune/pagination/DescribeDBInstancesPaginator.ts new file mode 100644 index 0000000000000..e6aadab8696b1 --- /dev/null +++ b/clients/client-neptune/pagination/DescribeDBInstancesPaginator.ts @@ -0,0 +1,51 @@ +import { Neptune } from "../Neptune"; +import { NeptuneClient } from "../NeptuneClient"; +import { + DescribeDBInstancesCommand, + DescribeDBInstancesCommandInput, + DescribeDBInstancesCommandOutput, +} from "../commands/DescribeDBInstancesCommand"; +import { NeptunePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: NeptuneClient, + input: DescribeDBInstancesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeDBInstancesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Neptune, + input: DescribeDBInstancesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeDBInstances(input, ...args); +}; +export async function* describeDBInstancesPaginate( + config: NeptunePaginationConfiguration, + input: DescribeDBInstancesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeDBInstancesCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof Neptune) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof NeptuneClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Neptune | NeptuneClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-neptune/pagination/DescribeDBParameterGroupsPaginator.ts b/clients/client-neptune/pagination/DescribeDBParameterGroupsPaginator.ts new file mode 100644 index 0000000000000..0b61a6516868e --- /dev/null +++ b/clients/client-neptune/pagination/DescribeDBParameterGroupsPaginator.ts @@ -0,0 +1,51 @@ +import { Neptune } from "../Neptune"; +import { NeptuneClient } from "../NeptuneClient"; +import { + DescribeDBParameterGroupsCommand, + DescribeDBParameterGroupsCommandInput, + DescribeDBParameterGroupsCommandOutput, +} from "../commands/DescribeDBParameterGroupsCommand"; +import { NeptunePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: NeptuneClient, + input: DescribeDBParameterGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeDBParameterGroupsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Neptune, + input: DescribeDBParameterGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeDBParameterGroups(input, ...args); +}; +export async function* describeDBParameterGroupsPaginate( + config: NeptunePaginationConfiguration, + input: DescribeDBParameterGroupsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeDBParameterGroupsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof Neptune) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof NeptuneClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Neptune | NeptuneClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-neptune/pagination/DescribeDBParametersPaginator.ts b/clients/client-neptune/pagination/DescribeDBParametersPaginator.ts new file mode 100644 index 0000000000000..0dc40f8b8720d --- /dev/null +++ b/clients/client-neptune/pagination/DescribeDBParametersPaginator.ts @@ -0,0 +1,51 @@ +import { Neptune } from "../Neptune"; +import { NeptuneClient } from "../NeptuneClient"; +import { + DescribeDBParametersCommand, + DescribeDBParametersCommandInput, + DescribeDBParametersCommandOutput, +} from "../commands/DescribeDBParametersCommand"; +import { NeptunePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: NeptuneClient, + input: DescribeDBParametersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeDBParametersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Neptune, + input: DescribeDBParametersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeDBParameters(input, ...args); +}; +export async function* describeDBParametersPaginate( + config: NeptunePaginationConfiguration, + input: DescribeDBParametersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeDBParametersCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof Neptune) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof NeptuneClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Neptune | NeptuneClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-neptune/pagination/DescribeDBSubnetGroupsPaginator.ts b/clients/client-neptune/pagination/DescribeDBSubnetGroupsPaginator.ts new file mode 100644 index 0000000000000..12c61429c1453 --- /dev/null +++ b/clients/client-neptune/pagination/DescribeDBSubnetGroupsPaginator.ts @@ -0,0 +1,51 @@ +import { Neptune } from "../Neptune"; +import { NeptuneClient } from "../NeptuneClient"; +import { + DescribeDBSubnetGroupsCommand, + DescribeDBSubnetGroupsCommandInput, + DescribeDBSubnetGroupsCommandOutput, +} from "../commands/DescribeDBSubnetGroupsCommand"; +import { NeptunePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: NeptuneClient, + input: DescribeDBSubnetGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeDBSubnetGroupsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Neptune, + input: DescribeDBSubnetGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeDBSubnetGroups(input, ...args); +}; +export async function* describeDBSubnetGroupsPaginate( + config: NeptunePaginationConfiguration, + input: DescribeDBSubnetGroupsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeDBSubnetGroupsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof Neptune) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof NeptuneClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Neptune | NeptuneClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-neptune/pagination/DescribeEventSubscriptionsPaginator.ts b/clients/client-neptune/pagination/DescribeEventSubscriptionsPaginator.ts new file mode 100644 index 0000000000000..fae9bbc95203e --- /dev/null +++ b/clients/client-neptune/pagination/DescribeEventSubscriptionsPaginator.ts @@ -0,0 +1,51 @@ +import { Neptune } from "../Neptune"; +import { NeptuneClient } from "../NeptuneClient"; +import { + DescribeEventSubscriptionsCommand, + DescribeEventSubscriptionsCommandInput, + DescribeEventSubscriptionsCommandOutput, +} from "../commands/DescribeEventSubscriptionsCommand"; +import { NeptunePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: NeptuneClient, + input: DescribeEventSubscriptionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeEventSubscriptionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Neptune, + input: DescribeEventSubscriptionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeEventSubscriptions(input, ...args); +}; +export async function* describeEventSubscriptionsPaginate( + config: NeptunePaginationConfiguration, + input: DescribeEventSubscriptionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeEventSubscriptionsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof Neptune) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof NeptuneClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Neptune | NeptuneClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-neptune/pagination/DescribeEventsPaginator.ts b/clients/client-neptune/pagination/DescribeEventsPaginator.ts new file mode 100644 index 0000000000000..fc3e571c89661 --- /dev/null +++ b/clients/client-neptune/pagination/DescribeEventsPaginator.ts @@ -0,0 +1,51 @@ +import { Neptune } from "../Neptune"; +import { NeptuneClient } from "../NeptuneClient"; +import { + DescribeEventsCommand, + DescribeEventsCommandInput, + DescribeEventsCommandOutput, +} from "../commands/DescribeEventsCommand"; +import { NeptunePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: NeptuneClient, + input: DescribeEventsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeEventsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Neptune, + input: DescribeEventsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeEvents(input, ...args); +}; +export async function* describeEventsPaginate( + config: NeptunePaginationConfiguration, + input: DescribeEventsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeEventsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof Neptune) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof NeptuneClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Neptune | NeptuneClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-neptune/pagination/DescribeOrderableDBInstanceOptionsPaginator.ts b/clients/client-neptune/pagination/DescribeOrderableDBInstanceOptionsPaginator.ts new file mode 100644 index 0000000000000..3bd1a1c115570 --- /dev/null +++ b/clients/client-neptune/pagination/DescribeOrderableDBInstanceOptionsPaginator.ts @@ -0,0 +1,51 @@ +import { Neptune } from "../Neptune"; +import { NeptuneClient } from "../NeptuneClient"; +import { + DescribeOrderableDBInstanceOptionsCommand, + DescribeOrderableDBInstanceOptionsCommandInput, + DescribeOrderableDBInstanceOptionsCommandOutput, +} from "../commands/DescribeOrderableDBInstanceOptionsCommand"; +import { NeptunePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: NeptuneClient, + input: DescribeOrderableDBInstanceOptionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeOrderableDBInstanceOptionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Neptune, + input: DescribeOrderableDBInstanceOptionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeOrderableDBInstanceOptions(input, ...args); +}; +export async function* describeOrderableDBInstanceOptionsPaginate( + config: NeptunePaginationConfiguration, + input: DescribeOrderableDBInstanceOptionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeOrderableDBInstanceOptionsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof Neptune) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof NeptuneClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Neptune | NeptuneClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-neptune/pagination/Interfaces.ts b/clients/client-neptune/pagination/Interfaces.ts new file mode 100644 index 0000000000000..aada58470a7e8 --- /dev/null +++ b/clients/client-neptune/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { Neptune } from "../Neptune"; +import { NeptuneClient } from "../NeptuneClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface NeptunePaginationConfiguration extends PaginationConfiguration { + client: Neptune | NeptuneClient; +} diff --git a/clients/client-networkmanager/index.ts b/clients/client-networkmanager/index.ts index 8e11e1b8c5c24..bc1819d4b23ea 100644 --- a/clients/client-networkmanager/index.ts +++ b/clients/client-networkmanager/index.ts @@ -12,14 +12,21 @@ export * from "./commands/DeleteLinkCommand"; export * from "./commands/DeleteSiteCommand"; export * from "./commands/DeregisterTransitGatewayCommand"; export * from "./commands/DescribeGlobalNetworksCommand"; +export * from "./pagination/DescribeGlobalNetworksPaginator"; export * from "./commands/DisassociateCustomerGatewayCommand"; export * from "./commands/DisassociateLinkCommand"; export * from "./commands/GetCustomerGatewayAssociationsCommand"; +export * from "./pagination/GetCustomerGatewayAssociationsPaginator"; export * from "./commands/GetDevicesCommand"; +export * from "./pagination/GetDevicesPaginator"; export * from "./commands/GetLinkAssociationsCommand"; +export * from "./pagination/GetLinkAssociationsPaginator"; export * from "./commands/GetLinksCommand"; +export * from "./pagination/GetLinksPaginator"; export * from "./commands/GetSitesCommand"; +export * from "./pagination/GetSitesPaginator"; export * from "./commands/GetTransitGatewayRegistrationsCommand"; +export * from "./pagination/GetTransitGatewayRegistrationsPaginator"; export * from "./commands/ListTagsForResourceCommand"; export * from "./commands/RegisterTransitGatewayCommand"; export * from "./commands/TagResourceCommand"; @@ -28,4 +35,5 @@ export * from "./commands/UpdateDeviceCommand"; export * from "./commands/UpdateGlobalNetworkCommand"; export * from "./commands/UpdateLinkCommand"; export * from "./commands/UpdateSiteCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-networkmanager/pagination/DescribeGlobalNetworksPaginator.ts b/clients/client-networkmanager/pagination/DescribeGlobalNetworksPaginator.ts new file mode 100644 index 0000000000000..db4df8e7da036 --- /dev/null +++ b/clients/client-networkmanager/pagination/DescribeGlobalNetworksPaginator.ts @@ -0,0 +1,51 @@ +import { NetworkManager } from "../NetworkManager"; +import { NetworkManagerClient } from "../NetworkManagerClient"; +import { + DescribeGlobalNetworksCommand, + DescribeGlobalNetworksCommandInput, + DescribeGlobalNetworksCommandOutput, +} from "../commands/DescribeGlobalNetworksCommand"; +import { NetworkManagerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: NetworkManagerClient, + input: DescribeGlobalNetworksCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeGlobalNetworksCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: NetworkManager, + input: DescribeGlobalNetworksCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeGlobalNetworks(input, ...args); +}; +export async function* describeGlobalNetworksPaginate( + config: NetworkManagerPaginationConfiguration, + input: DescribeGlobalNetworksCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeGlobalNetworksCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof NetworkManager) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof NetworkManagerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected NetworkManager | NetworkManagerClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-networkmanager/pagination/GetCustomerGatewayAssociationsPaginator.ts b/clients/client-networkmanager/pagination/GetCustomerGatewayAssociationsPaginator.ts new file mode 100644 index 0000000000000..c4bf04844b0b2 --- /dev/null +++ b/clients/client-networkmanager/pagination/GetCustomerGatewayAssociationsPaginator.ts @@ -0,0 +1,51 @@ +import { NetworkManager } from "../NetworkManager"; +import { NetworkManagerClient } from "../NetworkManagerClient"; +import { + GetCustomerGatewayAssociationsCommand, + GetCustomerGatewayAssociationsCommandInput, + GetCustomerGatewayAssociationsCommandOutput, +} from "../commands/GetCustomerGatewayAssociationsCommand"; +import { NetworkManagerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: NetworkManagerClient, + input: GetCustomerGatewayAssociationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetCustomerGatewayAssociationsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: NetworkManager, + input: GetCustomerGatewayAssociationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getCustomerGatewayAssociations(input, ...args); +}; +export async function* getCustomerGatewayAssociationsPaginate( + config: NetworkManagerPaginationConfiguration, + input: GetCustomerGatewayAssociationsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetCustomerGatewayAssociationsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof NetworkManager) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof NetworkManagerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected NetworkManager | NetworkManagerClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-networkmanager/pagination/GetDevicesPaginator.ts b/clients/client-networkmanager/pagination/GetDevicesPaginator.ts new file mode 100644 index 0000000000000..3f220bb9ac29b --- /dev/null +++ b/clients/client-networkmanager/pagination/GetDevicesPaginator.ts @@ -0,0 +1,47 @@ +import { NetworkManager } from "../NetworkManager"; +import { NetworkManagerClient } from "../NetworkManagerClient"; +import { GetDevicesCommand, GetDevicesCommandInput, GetDevicesCommandOutput } from "../commands/GetDevicesCommand"; +import { NetworkManagerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: NetworkManagerClient, + input: GetDevicesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetDevicesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: NetworkManager, + input: GetDevicesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getDevices(input, ...args); +}; +export async function* getDevicesPaginate( + config: NetworkManagerPaginationConfiguration, + input: GetDevicesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetDevicesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof NetworkManager) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof NetworkManagerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected NetworkManager | NetworkManagerClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-networkmanager/pagination/GetLinkAssociationsPaginator.ts b/clients/client-networkmanager/pagination/GetLinkAssociationsPaginator.ts new file mode 100644 index 0000000000000..827bdf7447c3c --- /dev/null +++ b/clients/client-networkmanager/pagination/GetLinkAssociationsPaginator.ts @@ -0,0 +1,51 @@ +import { NetworkManager } from "../NetworkManager"; +import { NetworkManagerClient } from "../NetworkManagerClient"; +import { + GetLinkAssociationsCommand, + GetLinkAssociationsCommandInput, + GetLinkAssociationsCommandOutput, +} from "../commands/GetLinkAssociationsCommand"; +import { NetworkManagerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: NetworkManagerClient, + input: GetLinkAssociationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetLinkAssociationsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: NetworkManager, + input: GetLinkAssociationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getLinkAssociations(input, ...args); +}; +export async function* getLinkAssociationsPaginate( + config: NetworkManagerPaginationConfiguration, + input: GetLinkAssociationsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetLinkAssociationsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof NetworkManager) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof NetworkManagerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected NetworkManager | NetworkManagerClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-networkmanager/pagination/GetLinksPaginator.ts b/clients/client-networkmanager/pagination/GetLinksPaginator.ts new file mode 100644 index 0000000000000..cd46e559dbb36 --- /dev/null +++ b/clients/client-networkmanager/pagination/GetLinksPaginator.ts @@ -0,0 +1,47 @@ +import { NetworkManager } from "../NetworkManager"; +import { NetworkManagerClient } from "../NetworkManagerClient"; +import { GetLinksCommand, GetLinksCommandInput, GetLinksCommandOutput } from "../commands/GetLinksCommand"; +import { NetworkManagerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: NetworkManagerClient, + input: GetLinksCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetLinksCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: NetworkManager, + input: GetLinksCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getLinks(input, ...args); +}; +export async function* getLinksPaginate( + config: NetworkManagerPaginationConfiguration, + input: GetLinksCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetLinksCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof NetworkManager) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof NetworkManagerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected NetworkManager | NetworkManagerClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-networkmanager/pagination/GetSitesPaginator.ts b/clients/client-networkmanager/pagination/GetSitesPaginator.ts new file mode 100644 index 0000000000000..c88022b87c9a1 --- /dev/null +++ b/clients/client-networkmanager/pagination/GetSitesPaginator.ts @@ -0,0 +1,47 @@ +import { NetworkManager } from "../NetworkManager"; +import { NetworkManagerClient } from "../NetworkManagerClient"; +import { GetSitesCommand, GetSitesCommandInput, GetSitesCommandOutput } from "../commands/GetSitesCommand"; +import { NetworkManagerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: NetworkManagerClient, + input: GetSitesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetSitesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: NetworkManager, + input: GetSitesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getSites(input, ...args); +}; +export async function* getSitesPaginate( + config: NetworkManagerPaginationConfiguration, + input: GetSitesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetSitesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof NetworkManager) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof NetworkManagerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected NetworkManager | NetworkManagerClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-networkmanager/pagination/GetTransitGatewayRegistrationsPaginator.ts b/clients/client-networkmanager/pagination/GetTransitGatewayRegistrationsPaginator.ts new file mode 100644 index 0000000000000..f4f02fdc40486 --- /dev/null +++ b/clients/client-networkmanager/pagination/GetTransitGatewayRegistrationsPaginator.ts @@ -0,0 +1,51 @@ +import { NetworkManager } from "../NetworkManager"; +import { NetworkManagerClient } from "../NetworkManagerClient"; +import { + GetTransitGatewayRegistrationsCommand, + GetTransitGatewayRegistrationsCommandInput, + GetTransitGatewayRegistrationsCommandOutput, +} from "../commands/GetTransitGatewayRegistrationsCommand"; +import { NetworkManagerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: NetworkManagerClient, + input: GetTransitGatewayRegistrationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetTransitGatewayRegistrationsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: NetworkManager, + input: GetTransitGatewayRegistrationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getTransitGatewayRegistrations(input, ...args); +}; +export async function* getTransitGatewayRegistrationsPaginate( + config: NetworkManagerPaginationConfiguration, + input: GetTransitGatewayRegistrationsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetTransitGatewayRegistrationsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof NetworkManager) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof NetworkManagerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected NetworkManager | NetworkManagerClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-networkmanager/pagination/Interfaces.ts b/clients/client-networkmanager/pagination/Interfaces.ts new file mode 100644 index 0000000000000..bbf1243ea4e53 --- /dev/null +++ b/clients/client-networkmanager/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { NetworkManager } from "../NetworkManager"; +import { NetworkManagerClient } from "../NetworkManagerClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface NetworkManagerPaginationConfiguration extends PaginationConfiguration { + client: NetworkManager | NetworkManagerClient; +} diff --git a/clients/client-opsworks/index.ts b/clients/client-opsworks/index.ts index 15daba5fc2a36..b98a1b369a149 100644 --- a/clients/client-opsworks/index.ts +++ b/clients/client-opsworks/index.ts @@ -26,6 +26,7 @@ export * from "./commands/DescribeAppsCommand"; export * from "./commands/DescribeCommandsCommand"; export * from "./commands/DescribeDeploymentsCommand"; export * from "./commands/DescribeEcsClustersCommand"; +export * from "./pagination/DescribeEcsClustersPaginator"; export * from "./commands/DescribeElasticIpsCommand"; export * from "./commands/DescribeElasticLoadBalancersCommand"; export * from "./commands/DescribeInstancesCommand"; @@ -74,4 +75,5 @@ export * from "./commands/UpdateRdsDbInstanceCommand"; export * from "./commands/UpdateStackCommand"; export * from "./commands/UpdateUserProfileCommand"; export * from "./commands/UpdateVolumeCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-opsworks/pagination/DescribeEcsClustersPaginator.ts b/clients/client-opsworks/pagination/DescribeEcsClustersPaginator.ts new file mode 100644 index 0000000000000..9d11798732486 --- /dev/null +++ b/clients/client-opsworks/pagination/DescribeEcsClustersPaginator.ts @@ -0,0 +1,51 @@ +import { OpsWorks } from "../OpsWorks"; +import { OpsWorksClient } from "../OpsWorksClient"; +import { + DescribeEcsClustersCommand, + DescribeEcsClustersCommandInput, + DescribeEcsClustersCommandOutput, +} from "../commands/DescribeEcsClustersCommand"; +import { OpsWorksPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: OpsWorksClient, + input: DescribeEcsClustersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeEcsClustersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: OpsWorks, + input: DescribeEcsClustersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeEcsClusters(input, ...args); +}; +export async function* describeEcsClustersPaginate( + config: OpsWorksPaginationConfiguration, + input: DescribeEcsClustersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeEcsClustersCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof OpsWorks) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof OpsWorksClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected OpsWorks | OpsWorksClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-opsworks/pagination/Interfaces.ts b/clients/client-opsworks/pagination/Interfaces.ts new file mode 100644 index 0000000000000..96022d314ae95 --- /dev/null +++ b/clients/client-opsworks/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { OpsWorks } from "../OpsWorks"; +import { OpsWorksClient } from "../OpsWorksClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface OpsWorksPaginationConfiguration extends PaginationConfiguration { + client: OpsWorks | OpsWorksClient; +} diff --git a/clients/client-opsworkscm/index.ts b/clients/client-opsworkscm/index.ts index f9d5067155cec..967914b636a3f 100644 --- a/clients/client-opsworkscm/index.ts +++ b/clients/client-opsworkscm/index.ts @@ -7,16 +7,21 @@ export * from "./commands/DeleteBackupCommand"; export * from "./commands/DeleteServerCommand"; export * from "./commands/DescribeAccountAttributesCommand"; export * from "./commands/DescribeBackupsCommand"; +export * from "./pagination/DescribeBackupsPaginator"; export * from "./commands/DescribeEventsCommand"; +export * from "./pagination/DescribeEventsPaginator"; export * from "./commands/DescribeNodeAssociationStatusCommand"; export * from "./commands/DescribeServersCommand"; +export * from "./pagination/DescribeServersPaginator"; export * from "./commands/DisassociateNodeCommand"; export * from "./commands/ExportServerEngineAttributeCommand"; export * from "./commands/ListTagsForResourceCommand"; +export * from "./pagination/ListTagsForResourcePaginator"; export * from "./commands/RestoreServerCommand"; export * from "./commands/StartMaintenanceCommand"; export * from "./commands/TagResourceCommand"; export * from "./commands/UntagResourceCommand"; export * from "./commands/UpdateServerCommand"; export * from "./commands/UpdateServerEngineAttributesCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-opsworkscm/pagination/DescribeBackupsPaginator.ts b/clients/client-opsworkscm/pagination/DescribeBackupsPaginator.ts new file mode 100644 index 0000000000000..0bbac884df160 --- /dev/null +++ b/clients/client-opsworkscm/pagination/DescribeBackupsPaginator.ts @@ -0,0 +1,51 @@ +import { OpsWorksCM } from "../OpsWorksCM"; +import { OpsWorksCMClient } from "../OpsWorksCMClient"; +import { + DescribeBackupsCommand, + DescribeBackupsCommandInput, + DescribeBackupsCommandOutput, +} from "../commands/DescribeBackupsCommand"; +import { OpsWorksCMPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: OpsWorksCMClient, + input: DescribeBackupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeBackupsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: OpsWorksCM, + input: DescribeBackupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeBackups(input, ...args); +}; +export async function* describeBackupsPaginate( + config: OpsWorksCMPaginationConfiguration, + input: DescribeBackupsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeBackupsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof OpsWorksCM) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof OpsWorksCMClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected OpsWorksCM | OpsWorksCMClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-opsworkscm/pagination/DescribeEventsPaginator.ts b/clients/client-opsworkscm/pagination/DescribeEventsPaginator.ts new file mode 100644 index 0000000000000..1fd84634ebc45 --- /dev/null +++ b/clients/client-opsworkscm/pagination/DescribeEventsPaginator.ts @@ -0,0 +1,51 @@ +import { OpsWorksCM } from "../OpsWorksCM"; +import { OpsWorksCMClient } from "../OpsWorksCMClient"; +import { + DescribeEventsCommand, + DescribeEventsCommandInput, + DescribeEventsCommandOutput, +} from "../commands/DescribeEventsCommand"; +import { OpsWorksCMPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: OpsWorksCMClient, + input: DescribeEventsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeEventsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: OpsWorksCM, + input: DescribeEventsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeEvents(input, ...args); +}; +export async function* describeEventsPaginate( + config: OpsWorksCMPaginationConfiguration, + input: DescribeEventsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeEventsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof OpsWorksCM) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof OpsWorksCMClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected OpsWorksCM | OpsWorksCMClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-opsworkscm/pagination/DescribeServersPaginator.ts b/clients/client-opsworkscm/pagination/DescribeServersPaginator.ts new file mode 100644 index 0000000000000..25281a2bc9282 --- /dev/null +++ b/clients/client-opsworkscm/pagination/DescribeServersPaginator.ts @@ -0,0 +1,51 @@ +import { OpsWorksCM } from "../OpsWorksCM"; +import { OpsWorksCMClient } from "../OpsWorksCMClient"; +import { + DescribeServersCommand, + DescribeServersCommandInput, + DescribeServersCommandOutput, +} from "../commands/DescribeServersCommand"; +import { OpsWorksCMPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: OpsWorksCMClient, + input: DescribeServersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeServersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: OpsWorksCM, + input: DescribeServersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeServers(input, ...args); +}; +export async function* describeServersPaginate( + config: OpsWorksCMPaginationConfiguration, + input: DescribeServersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeServersCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof OpsWorksCM) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof OpsWorksCMClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected OpsWorksCM | OpsWorksCMClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-opsworkscm/pagination/Interfaces.ts b/clients/client-opsworkscm/pagination/Interfaces.ts new file mode 100644 index 0000000000000..c20a3cdddf62b --- /dev/null +++ b/clients/client-opsworkscm/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { OpsWorksCM } from "../OpsWorksCM"; +import { OpsWorksCMClient } from "../OpsWorksCMClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface OpsWorksCMPaginationConfiguration extends PaginationConfiguration { + client: OpsWorksCM | OpsWorksCMClient; +} diff --git a/clients/client-opsworkscm/pagination/ListTagsForResourcePaginator.ts b/clients/client-opsworkscm/pagination/ListTagsForResourcePaginator.ts new file mode 100644 index 0000000000000..d5accfd3ec5f6 --- /dev/null +++ b/clients/client-opsworkscm/pagination/ListTagsForResourcePaginator.ts @@ -0,0 +1,51 @@ +import { OpsWorksCM } from "../OpsWorksCM"; +import { OpsWorksCMClient } from "../OpsWorksCMClient"; +import { + ListTagsForResourceCommand, + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput, +} from "../commands/ListTagsForResourceCommand"; +import { OpsWorksCMPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: OpsWorksCMClient, + input: ListTagsForResourceCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTagsForResourceCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: OpsWorksCM, + input: ListTagsForResourceCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTagsForResource(input, ...args); +}; +export async function* listTagsForResourcePaginate( + config: OpsWorksCMPaginationConfiguration, + input: ListTagsForResourceCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTagsForResourceCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof OpsWorksCM) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof OpsWorksCMClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected OpsWorksCM | OpsWorksCMClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-organizations/index.ts b/clients/client-organizations/index.ts index f85820619da86..a60b16fcd7c5a 100644 --- a/clients/client-organizations/index.ts +++ b/clients/client-organizations/index.ts @@ -29,21 +29,37 @@ export * from "./commands/EnablePolicyTypeCommand"; export * from "./commands/InviteAccountToOrganizationCommand"; export * from "./commands/LeaveOrganizationCommand"; export * from "./commands/ListAccountsCommand"; +export * from "./pagination/ListAccountsPaginator"; export * from "./commands/ListAccountsForParentCommand"; +export * from "./pagination/ListAccountsForParentPaginator"; export * from "./commands/ListAWSServiceAccessForOrganizationCommand"; +export * from "./pagination/ListAWSServiceAccessForOrganizationPaginator"; export * from "./commands/ListChildrenCommand"; +export * from "./pagination/ListChildrenPaginator"; export * from "./commands/ListCreateAccountStatusCommand"; +export * from "./pagination/ListCreateAccountStatusPaginator"; export * from "./commands/ListDelegatedAdministratorsCommand"; +export * from "./pagination/ListDelegatedAdministratorsPaginator"; export * from "./commands/ListDelegatedServicesForAccountCommand"; +export * from "./pagination/ListDelegatedServicesForAccountPaginator"; export * from "./commands/ListHandshakesForAccountCommand"; +export * from "./pagination/ListHandshakesForAccountPaginator"; export * from "./commands/ListHandshakesForOrganizationCommand"; +export * from "./pagination/ListHandshakesForOrganizationPaginator"; export * from "./commands/ListOrganizationalUnitsForParentCommand"; +export * from "./pagination/ListOrganizationalUnitsForParentPaginator"; export * from "./commands/ListParentsCommand"; +export * from "./pagination/ListParentsPaginator"; export * from "./commands/ListPoliciesCommand"; +export * from "./pagination/ListPoliciesPaginator"; export * from "./commands/ListPoliciesForTargetCommand"; +export * from "./pagination/ListPoliciesForTargetPaginator"; export * from "./commands/ListRootsCommand"; +export * from "./pagination/ListRootsPaginator"; export * from "./commands/ListTagsForResourceCommand"; +export * from "./pagination/ListTagsForResourcePaginator"; export * from "./commands/ListTargetsForPolicyCommand"; +export * from "./pagination/ListTargetsForPolicyPaginator"; export * from "./commands/MoveAccountCommand"; export * from "./commands/RegisterDelegatedAdministratorCommand"; export * from "./commands/RemoveAccountFromOrganizationCommand"; @@ -51,4 +67,5 @@ export * from "./commands/TagResourceCommand"; export * from "./commands/UntagResourceCommand"; export * from "./commands/UpdateOrganizationalUnitCommand"; export * from "./commands/UpdatePolicyCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-organizations/pagination/Interfaces.ts b/clients/client-organizations/pagination/Interfaces.ts new file mode 100644 index 0000000000000..b0cb308a866ff --- /dev/null +++ b/clients/client-organizations/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { Organizations } from "../Organizations"; +import { OrganizationsClient } from "../OrganizationsClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface OrganizationsPaginationConfiguration extends PaginationConfiguration { + client: Organizations | OrganizationsClient; +} diff --git a/clients/client-organizations/pagination/ListAWSServiceAccessForOrganizationPaginator.ts b/clients/client-organizations/pagination/ListAWSServiceAccessForOrganizationPaginator.ts new file mode 100644 index 0000000000000..d7da1885af1b4 --- /dev/null +++ b/clients/client-organizations/pagination/ListAWSServiceAccessForOrganizationPaginator.ts @@ -0,0 +1,51 @@ +import { Organizations } from "../Organizations"; +import { OrganizationsClient } from "../OrganizationsClient"; +import { + ListAWSServiceAccessForOrganizationCommand, + ListAWSServiceAccessForOrganizationCommandInput, + ListAWSServiceAccessForOrganizationCommandOutput, +} from "../commands/ListAWSServiceAccessForOrganizationCommand"; +import { OrganizationsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: OrganizationsClient, + input: ListAWSServiceAccessForOrganizationCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListAWSServiceAccessForOrganizationCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Organizations, + input: ListAWSServiceAccessForOrganizationCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listAWSServiceAccessForOrganization(input, ...args); +}; +export async function* listAWSServiceAccessForOrganizationPaginate( + config: OrganizationsPaginationConfiguration, + input: ListAWSServiceAccessForOrganizationCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListAWSServiceAccessForOrganizationCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Organizations) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof OrganizationsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Organizations | OrganizationsClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-organizations/pagination/ListAccountsForParentPaginator.ts b/clients/client-organizations/pagination/ListAccountsForParentPaginator.ts new file mode 100644 index 0000000000000..ff713f33fcb08 --- /dev/null +++ b/clients/client-organizations/pagination/ListAccountsForParentPaginator.ts @@ -0,0 +1,51 @@ +import { Organizations } from "../Organizations"; +import { OrganizationsClient } from "../OrganizationsClient"; +import { + ListAccountsForParentCommand, + ListAccountsForParentCommandInput, + ListAccountsForParentCommandOutput, +} from "../commands/ListAccountsForParentCommand"; +import { OrganizationsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: OrganizationsClient, + input: ListAccountsForParentCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListAccountsForParentCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Organizations, + input: ListAccountsForParentCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listAccountsForParent(input, ...args); +}; +export async function* listAccountsForParentPaginate( + config: OrganizationsPaginationConfiguration, + input: ListAccountsForParentCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListAccountsForParentCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Organizations) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof OrganizationsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Organizations | OrganizationsClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-organizations/pagination/ListAccountsPaginator.ts b/clients/client-organizations/pagination/ListAccountsPaginator.ts new file mode 100644 index 0000000000000..0d6a9bb6aad98 --- /dev/null +++ b/clients/client-organizations/pagination/ListAccountsPaginator.ts @@ -0,0 +1,51 @@ +import { Organizations } from "../Organizations"; +import { OrganizationsClient } from "../OrganizationsClient"; +import { + ListAccountsCommand, + ListAccountsCommandInput, + ListAccountsCommandOutput, +} from "../commands/ListAccountsCommand"; +import { OrganizationsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: OrganizationsClient, + input: ListAccountsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListAccountsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Organizations, + input: ListAccountsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listAccounts(input, ...args); +}; +export async function* listAccountsPaginate( + config: OrganizationsPaginationConfiguration, + input: ListAccountsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListAccountsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Organizations) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof OrganizationsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Organizations | OrganizationsClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-organizations/pagination/ListChildrenPaginator.ts b/clients/client-organizations/pagination/ListChildrenPaginator.ts new file mode 100644 index 0000000000000..62ca1f235a58a --- /dev/null +++ b/clients/client-organizations/pagination/ListChildrenPaginator.ts @@ -0,0 +1,51 @@ +import { Organizations } from "../Organizations"; +import { OrganizationsClient } from "../OrganizationsClient"; +import { + ListChildrenCommand, + ListChildrenCommandInput, + ListChildrenCommandOutput, +} from "../commands/ListChildrenCommand"; +import { OrganizationsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: OrganizationsClient, + input: ListChildrenCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListChildrenCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Organizations, + input: ListChildrenCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listChildren(input, ...args); +}; +export async function* listChildrenPaginate( + config: OrganizationsPaginationConfiguration, + input: ListChildrenCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListChildrenCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Organizations) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof OrganizationsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Organizations | OrganizationsClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-organizations/pagination/ListCreateAccountStatusPaginator.ts b/clients/client-organizations/pagination/ListCreateAccountStatusPaginator.ts new file mode 100644 index 0000000000000..c9298d873a32f --- /dev/null +++ b/clients/client-organizations/pagination/ListCreateAccountStatusPaginator.ts @@ -0,0 +1,51 @@ +import { Organizations } from "../Organizations"; +import { OrganizationsClient } from "../OrganizationsClient"; +import { + ListCreateAccountStatusCommand, + ListCreateAccountStatusCommandInput, + ListCreateAccountStatusCommandOutput, +} from "../commands/ListCreateAccountStatusCommand"; +import { OrganizationsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: OrganizationsClient, + input: ListCreateAccountStatusCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListCreateAccountStatusCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Organizations, + input: ListCreateAccountStatusCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listCreateAccountStatus(input, ...args); +}; +export async function* listCreateAccountStatusPaginate( + config: OrganizationsPaginationConfiguration, + input: ListCreateAccountStatusCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListCreateAccountStatusCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Organizations) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof OrganizationsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Organizations | OrganizationsClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-organizations/pagination/ListDelegatedAdministratorsPaginator.ts b/clients/client-organizations/pagination/ListDelegatedAdministratorsPaginator.ts new file mode 100644 index 0000000000000..d7323d14faec6 --- /dev/null +++ b/clients/client-organizations/pagination/ListDelegatedAdministratorsPaginator.ts @@ -0,0 +1,51 @@ +import { Organizations } from "../Organizations"; +import { OrganizationsClient } from "../OrganizationsClient"; +import { + ListDelegatedAdministratorsCommand, + ListDelegatedAdministratorsCommandInput, + ListDelegatedAdministratorsCommandOutput, +} from "../commands/ListDelegatedAdministratorsCommand"; +import { OrganizationsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: OrganizationsClient, + input: ListDelegatedAdministratorsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDelegatedAdministratorsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Organizations, + input: ListDelegatedAdministratorsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDelegatedAdministrators(input, ...args); +}; +export async function* listDelegatedAdministratorsPaginate( + config: OrganizationsPaginationConfiguration, + input: ListDelegatedAdministratorsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDelegatedAdministratorsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Organizations) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof OrganizationsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Organizations | OrganizationsClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-organizations/pagination/ListDelegatedServicesForAccountPaginator.ts b/clients/client-organizations/pagination/ListDelegatedServicesForAccountPaginator.ts new file mode 100644 index 0000000000000..3021b927d6b62 --- /dev/null +++ b/clients/client-organizations/pagination/ListDelegatedServicesForAccountPaginator.ts @@ -0,0 +1,51 @@ +import { Organizations } from "../Organizations"; +import { OrganizationsClient } from "../OrganizationsClient"; +import { + ListDelegatedServicesForAccountCommand, + ListDelegatedServicesForAccountCommandInput, + ListDelegatedServicesForAccountCommandOutput, +} from "../commands/ListDelegatedServicesForAccountCommand"; +import { OrganizationsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: OrganizationsClient, + input: ListDelegatedServicesForAccountCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDelegatedServicesForAccountCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Organizations, + input: ListDelegatedServicesForAccountCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDelegatedServicesForAccount(input, ...args); +}; +export async function* listDelegatedServicesForAccountPaginate( + config: OrganizationsPaginationConfiguration, + input: ListDelegatedServicesForAccountCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDelegatedServicesForAccountCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Organizations) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof OrganizationsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Organizations | OrganizationsClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-organizations/pagination/ListHandshakesForAccountPaginator.ts b/clients/client-organizations/pagination/ListHandshakesForAccountPaginator.ts new file mode 100644 index 0000000000000..3fcdd72e445ee --- /dev/null +++ b/clients/client-organizations/pagination/ListHandshakesForAccountPaginator.ts @@ -0,0 +1,51 @@ +import { Organizations } from "../Organizations"; +import { OrganizationsClient } from "../OrganizationsClient"; +import { + ListHandshakesForAccountCommand, + ListHandshakesForAccountCommandInput, + ListHandshakesForAccountCommandOutput, +} from "../commands/ListHandshakesForAccountCommand"; +import { OrganizationsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: OrganizationsClient, + input: ListHandshakesForAccountCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListHandshakesForAccountCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Organizations, + input: ListHandshakesForAccountCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listHandshakesForAccount(input, ...args); +}; +export async function* listHandshakesForAccountPaginate( + config: OrganizationsPaginationConfiguration, + input: ListHandshakesForAccountCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListHandshakesForAccountCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Organizations) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof OrganizationsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Organizations | OrganizationsClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-organizations/pagination/ListHandshakesForOrganizationPaginator.ts b/clients/client-organizations/pagination/ListHandshakesForOrganizationPaginator.ts new file mode 100644 index 0000000000000..438d59bf1d4b0 --- /dev/null +++ b/clients/client-organizations/pagination/ListHandshakesForOrganizationPaginator.ts @@ -0,0 +1,51 @@ +import { Organizations } from "../Organizations"; +import { OrganizationsClient } from "../OrganizationsClient"; +import { + ListHandshakesForOrganizationCommand, + ListHandshakesForOrganizationCommandInput, + ListHandshakesForOrganizationCommandOutput, +} from "../commands/ListHandshakesForOrganizationCommand"; +import { OrganizationsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: OrganizationsClient, + input: ListHandshakesForOrganizationCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListHandshakesForOrganizationCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Organizations, + input: ListHandshakesForOrganizationCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listHandshakesForOrganization(input, ...args); +}; +export async function* listHandshakesForOrganizationPaginate( + config: OrganizationsPaginationConfiguration, + input: ListHandshakesForOrganizationCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListHandshakesForOrganizationCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Organizations) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof OrganizationsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Organizations | OrganizationsClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-organizations/pagination/ListOrganizationalUnitsForParentPaginator.ts b/clients/client-organizations/pagination/ListOrganizationalUnitsForParentPaginator.ts new file mode 100644 index 0000000000000..9e0ca315168d2 --- /dev/null +++ b/clients/client-organizations/pagination/ListOrganizationalUnitsForParentPaginator.ts @@ -0,0 +1,51 @@ +import { Organizations } from "../Organizations"; +import { OrganizationsClient } from "../OrganizationsClient"; +import { + ListOrganizationalUnitsForParentCommand, + ListOrganizationalUnitsForParentCommandInput, + ListOrganizationalUnitsForParentCommandOutput, +} from "../commands/ListOrganizationalUnitsForParentCommand"; +import { OrganizationsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: OrganizationsClient, + input: ListOrganizationalUnitsForParentCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListOrganizationalUnitsForParentCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Organizations, + input: ListOrganizationalUnitsForParentCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listOrganizationalUnitsForParent(input, ...args); +}; +export async function* listOrganizationalUnitsForParentPaginate( + config: OrganizationsPaginationConfiguration, + input: ListOrganizationalUnitsForParentCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListOrganizationalUnitsForParentCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Organizations) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof OrganizationsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Organizations | OrganizationsClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-organizations/pagination/ListParentsPaginator.ts b/clients/client-organizations/pagination/ListParentsPaginator.ts new file mode 100644 index 0000000000000..8f467cf7f7d93 --- /dev/null +++ b/clients/client-organizations/pagination/ListParentsPaginator.ts @@ -0,0 +1,47 @@ +import { Organizations } from "../Organizations"; +import { OrganizationsClient } from "../OrganizationsClient"; +import { ListParentsCommand, ListParentsCommandInput, ListParentsCommandOutput } from "../commands/ListParentsCommand"; +import { OrganizationsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: OrganizationsClient, + input: ListParentsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListParentsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Organizations, + input: ListParentsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listParents(input, ...args); +}; +export async function* listParentsPaginate( + config: OrganizationsPaginationConfiguration, + input: ListParentsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListParentsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Organizations) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof OrganizationsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Organizations | OrganizationsClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-organizations/pagination/ListPoliciesForTargetPaginator.ts b/clients/client-organizations/pagination/ListPoliciesForTargetPaginator.ts new file mode 100644 index 0000000000000..9e90000f8ded6 --- /dev/null +++ b/clients/client-organizations/pagination/ListPoliciesForTargetPaginator.ts @@ -0,0 +1,51 @@ +import { Organizations } from "../Organizations"; +import { OrganizationsClient } from "../OrganizationsClient"; +import { + ListPoliciesForTargetCommand, + ListPoliciesForTargetCommandInput, + ListPoliciesForTargetCommandOutput, +} from "../commands/ListPoliciesForTargetCommand"; +import { OrganizationsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: OrganizationsClient, + input: ListPoliciesForTargetCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListPoliciesForTargetCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Organizations, + input: ListPoliciesForTargetCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listPoliciesForTarget(input, ...args); +}; +export async function* listPoliciesForTargetPaginate( + config: OrganizationsPaginationConfiguration, + input: ListPoliciesForTargetCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListPoliciesForTargetCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Organizations) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof OrganizationsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Organizations | OrganizationsClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-organizations/pagination/ListPoliciesPaginator.ts b/clients/client-organizations/pagination/ListPoliciesPaginator.ts new file mode 100644 index 0000000000000..e97cfb19e5694 --- /dev/null +++ b/clients/client-organizations/pagination/ListPoliciesPaginator.ts @@ -0,0 +1,51 @@ +import { Organizations } from "../Organizations"; +import { OrganizationsClient } from "../OrganizationsClient"; +import { + ListPoliciesCommand, + ListPoliciesCommandInput, + ListPoliciesCommandOutput, +} from "../commands/ListPoliciesCommand"; +import { OrganizationsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: OrganizationsClient, + input: ListPoliciesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListPoliciesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Organizations, + input: ListPoliciesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listPolicies(input, ...args); +}; +export async function* listPoliciesPaginate( + config: OrganizationsPaginationConfiguration, + input: ListPoliciesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListPoliciesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Organizations) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof OrganizationsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Organizations | OrganizationsClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-organizations/pagination/ListRootsPaginator.ts b/clients/client-organizations/pagination/ListRootsPaginator.ts new file mode 100644 index 0000000000000..dc61240097857 --- /dev/null +++ b/clients/client-organizations/pagination/ListRootsPaginator.ts @@ -0,0 +1,47 @@ +import { Organizations } from "../Organizations"; +import { OrganizationsClient } from "../OrganizationsClient"; +import { ListRootsCommand, ListRootsCommandInput, ListRootsCommandOutput } from "../commands/ListRootsCommand"; +import { OrganizationsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: OrganizationsClient, + input: ListRootsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListRootsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Organizations, + input: ListRootsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listRoots(input, ...args); +}; +export async function* listRootsPaginate( + config: OrganizationsPaginationConfiguration, + input: ListRootsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListRootsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Organizations) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof OrganizationsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Organizations | OrganizationsClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-organizations/pagination/ListTagsForResourcePaginator.ts b/clients/client-organizations/pagination/ListTagsForResourcePaginator.ts new file mode 100644 index 0000000000000..4e684618c3de1 --- /dev/null +++ b/clients/client-organizations/pagination/ListTagsForResourcePaginator.ts @@ -0,0 +1,50 @@ +import { Organizations } from "../Organizations"; +import { OrganizationsClient } from "../OrganizationsClient"; +import { + ListTagsForResourceCommand, + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput, +} from "../commands/ListTagsForResourceCommand"; +import { OrganizationsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: OrganizationsClient, + input: ListTagsForResourceCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTagsForResourceCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Organizations, + input: ListTagsForResourceCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTagsForResource(input, ...args); +}; +export async function* listTagsForResourcePaginate( + config: OrganizationsPaginationConfiguration, + input: ListTagsForResourceCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTagsForResourceCommandOutput; + while (hasNext) { + input["NextToken"] = token; + if (config.client instanceof Organizations) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof OrganizationsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Organizations | OrganizationsClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-organizations/pagination/ListTargetsForPolicyPaginator.ts b/clients/client-organizations/pagination/ListTargetsForPolicyPaginator.ts new file mode 100644 index 0000000000000..f7ca1c3c0cd23 --- /dev/null +++ b/clients/client-organizations/pagination/ListTargetsForPolicyPaginator.ts @@ -0,0 +1,51 @@ +import { Organizations } from "../Organizations"; +import { OrganizationsClient } from "../OrganizationsClient"; +import { + ListTargetsForPolicyCommand, + ListTargetsForPolicyCommandInput, + ListTargetsForPolicyCommandOutput, +} from "../commands/ListTargetsForPolicyCommand"; +import { OrganizationsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: OrganizationsClient, + input: ListTargetsForPolicyCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTargetsForPolicyCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Organizations, + input: ListTargetsForPolicyCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTargetsForPolicy(input, ...args); +}; +export async function* listTargetsForPolicyPaginate( + config: OrganizationsPaginationConfiguration, + input: ListTargetsForPolicyCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTargetsForPolicyCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Organizations) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof OrganizationsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Organizations | OrganizationsClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-outposts/index.ts b/clients/client-outposts/index.ts index 9750b02b0fc7e..e3a1a332bc2d8 100644 --- a/clients/client-outposts/index.ts +++ b/clients/client-outposts/index.ts @@ -6,5 +6,8 @@ export * from "./commands/DeleteSiteCommand"; export * from "./commands/GetOutpostCommand"; export * from "./commands/GetOutpostInstanceTypesCommand"; export * from "./commands/ListOutpostsCommand"; +export * from "./pagination/ListOutpostsPaginator"; export * from "./commands/ListSitesCommand"; +export * from "./pagination/ListSitesPaginator"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-outposts/pagination/Interfaces.ts b/clients/client-outposts/pagination/Interfaces.ts new file mode 100644 index 0000000000000..372e512fe47f6 --- /dev/null +++ b/clients/client-outposts/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { Outposts } from "../Outposts"; +import { OutpostsClient } from "../OutpostsClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface OutpostsPaginationConfiguration extends PaginationConfiguration { + client: Outposts | OutpostsClient; +} diff --git a/clients/client-outposts/pagination/ListOutpostsPaginator.ts b/clients/client-outposts/pagination/ListOutpostsPaginator.ts new file mode 100644 index 0000000000000..6cb54736c257c --- /dev/null +++ b/clients/client-outposts/pagination/ListOutpostsPaginator.ts @@ -0,0 +1,51 @@ +import { Outposts } from "../Outposts"; +import { OutpostsClient } from "../OutpostsClient"; +import { + ListOutpostsCommand, + ListOutpostsCommandInput, + ListOutpostsCommandOutput, +} from "../commands/ListOutpostsCommand"; +import { OutpostsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: OutpostsClient, + input: ListOutpostsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListOutpostsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Outposts, + input: ListOutpostsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listOutposts(input, ...args); +}; +export async function* listOutpostsPaginate( + config: OutpostsPaginationConfiguration, + input: ListOutpostsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListOutpostsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Outposts) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof OutpostsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Outposts | OutpostsClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-outposts/pagination/ListSitesPaginator.ts b/clients/client-outposts/pagination/ListSitesPaginator.ts new file mode 100644 index 0000000000000..d6a4c5276d5e6 --- /dev/null +++ b/clients/client-outposts/pagination/ListSitesPaginator.ts @@ -0,0 +1,47 @@ +import { Outposts } from "../Outposts"; +import { OutpostsClient } from "../OutpostsClient"; +import { ListSitesCommand, ListSitesCommandInput, ListSitesCommandOutput } from "../commands/ListSitesCommand"; +import { OutpostsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: OutpostsClient, + input: ListSitesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListSitesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Outposts, + input: ListSitesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listSites(input, ...args); +}; +export async function* listSitesPaginate( + config: OutpostsPaginationConfiguration, + input: ListSitesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListSitesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Outposts) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof OutpostsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Outposts | OutpostsClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-personalize/index.ts b/clients/client-personalize/index.ts index d4d541e27987f..4b395d1df2e2d 100644 --- a/clients/client-personalize/index.ts +++ b/clients/client-personalize/index.ts @@ -32,15 +32,26 @@ export * from "./commands/DescribeSolutionCommand"; export * from "./commands/DescribeSolutionVersionCommand"; export * from "./commands/GetSolutionMetricsCommand"; export * from "./commands/ListBatchInferenceJobsCommand"; +export * from "./pagination/ListBatchInferenceJobsPaginator"; export * from "./commands/ListCampaignsCommand"; +export * from "./pagination/ListCampaignsPaginator"; export * from "./commands/ListDatasetGroupsCommand"; +export * from "./pagination/ListDatasetGroupsPaginator"; export * from "./commands/ListDatasetImportJobsCommand"; +export * from "./pagination/ListDatasetImportJobsPaginator"; export * from "./commands/ListDatasetsCommand"; +export * from "./pagination/ListDatasetsPaginator"; export * from "./commands/ListEventTrackersCommand"; +export * from "./pagination/ListEventTrackersPaginator"; export * from "./commands/ListFiltersCommand"; export * from "./commands/ListRecipesCommand"; +export * from "./pagination/ListRecipesPaginator"; export * from "./commands/ListSchemasCommand"; +export * from "./pagination/ListSchemasPaginator"; export * from "./commands/ListSolutionsCommand"; +export * from "./pagination/ListSolutionsPaginator"; export * from "./commands/ListSolutionVersionsCommand"; +export * from "./pagination/ListSolutionVersionsPaginator"; export * from "./commands/UpdateCampaignCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-personalize/pagination/Interfaces.ts b/clients/client-personalize/pagination/Interfaces.ts new file mode 100644 index 0000000000000..22e109a01ad75 --- /dev/null +++ b/clients/client-personalize/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { Personalize } from "../Personalize"; +import { PersonalizeClient } from "../PersonalizeClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface PersonalizePaginationConfiguration extends PaginationConfiguration { + client: Personalize | PersonalizeClient; +} diff --git a/clients/client-personalize/pagination/ListBatchInferenceJobsPaginator.ts b/clients/client-personalize/pagination/ListBatchInferenceJobsPaginator.ts new file mode 100644 index 0000000000000..16a5141242823 --- /dev/null +++ b/clients/client-personalize/pagination/ListBatchInferenceJobsPaginator.ts @@ -0,0 +1,51 @@ +import { Personalize } from "../Personalize"; +import { PersonalizeClient } from "../PersonalizeClient"; +import { + ListBatchInferenceJobsCommand, + ListBatchInferenceJobsCommandInput, + ListBatchInferenceJobsCommandOutput, +} from "../commands/ListBatchInferenceJobsCommand"; +import { PersonalizePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: PersonalizeClient, + input: ListBatchInferenceJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListBatchInferenceJobsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Personalize, + input: ListBatchInferenceJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listBatchInferenceJobs(input, ...args); +}; +export async function* listBatchInferenceJobsPaginate( + config: PersonalizePaginationConfiguration, + input: ListBatchInferenceJobsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListBatchInferenceJobsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof Personalize) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof PersonalizeClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Personalize | PersonalizeClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-personalize/pagination/ListCampaignsPaginator.ts b/clients/client-personalize/pagination/ListCampaignsPaginator.ts new file mode 100644 index 0000000000000..643022b4eacde --- /dev/null +++ b/clients/client-personalize/pagination/ListCampaignsPaginator.ts @@ -0,0 +1,51 @@ +import { Personalize } from "../Personalize"; +import { PersonalizeClient } from "../PersonalizeClient"; +import { + ListCampaignsCommand, + ListCampaignsCommandInput, + ListCampaignsCommandOutput, +} from "../commands/ListCampaignsCommand"; +import { PersonalizePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: PersonalizeClient, + input: ListCampaignsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListCampaignsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Personalize, + input: ListCampaignsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listCampaigns(input, ...args); +}; +export async function* listCampaignsPaginate( + config: PersonalizePaginationConfiguration, + input: ListCampaignsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListCampaignsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof Personalize) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof PersonalizeClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Personalize | PersonalizeClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-personalize/pagination/ListDatasetGroupsPaginator.ts b/clients/client-personalize/pagination/ListDatasetGroupsPaginator.ts new file mode 100644 index 0000000000000..9cda802f63264 --- /dev/null +++ b/clients/client-personalize/pagination/ListDatasetGroupsPaginator.ts @@ -0,0 +1,51 @@ +import { Personalize } from "../Personalize"; +import { PersonalizeClient } from "../PersonalizeClient"; +import { + ListDatasetGroupsCommand, + ListDatasetGroupsCommandInput, + ListDatasetGroupsCommandOutput, +} from "../commands/ListDatasetGroupsCommand"; +import { PersonalizePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: PersonalizeClient, + input: ListDatasetGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDatasetGroupsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Personalize, + input: ListDatasetGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDatasetGroups(input, ...args); +}; +export async function* listDatasetGroupsPaginate( + config: PersonalizePaginationConfiguration, + input: ListDatasetGroupsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDatasetGroupsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof Personalize) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof PersonalizeClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Personalize | PersonalizeClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-personalize/pagination/ListDatasetImportJobsPaginator.ts b/clients/client-personalize/pagination/ListDatasetImportJobsPaginator.ts new file mode 100644 index 0000000000000..1988983a0516f --- /dev/null +++ b/clients/client-personalize/pagination/ListDatasetImportJobsPaginator.ts @@ -0,0 +1,51 @@ +import { Personalize } from "../Personalize"; +import { PersonalizeClient } from "../PersonalizeClient"; +import { + ListDatasetImportJobsCommand, + ListDatasetImportJobsCommandInput, + ListDatasetImportJobsCommandOutput, +} from "../commands/ListDatasetImportJobsCommand"; +import { PersonalizePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: PersonalizeClient, + input: ListDatasetImportJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDatasetImportJobsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Personalize, + input: ListDatasetImportJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDatasetImportJobs(input, ...args); +}; +export async function* listDatasetImportJobsPaginate( + config: PersonalizePaginationConfiguration, + input: ListDatasetImportJobsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDatasetImportJobsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof Personalize) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof PersonalizeClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Personalize | PersonalizeClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-personalize/pagination/ListDatasetsPaginator.ts b/clients/client-personalize/pagination/ListDatasetsPaginator.ts new file mode 100644 index 0000000000000..b22c93f4a6b6d --- /dev/null +++ b/clients/client-personalize/pagination/ListDatasetsPaginator.ts @@ -0,0 +1,51 @@ +import { Personalize } from "../Personalize"; +import { PersonalizeClient } from "../PersonalizeClient"; +import { + ListDatasetsCommand, + ListDatasetsCommandInput, + ListDatasetsCommandOutput, +} from "../commands/ListDatasetsCommand"; +import { PersonalizePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: PersonalizeClient, + input: ListDatasetsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDatasetsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Personalize, + input: ListDatasetsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDatasets(input, ...args); +}; +export async function* listDatasetsPaginate( + config: PersonalizePaginationConfiguration, + input: ListDatasetsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDatasetsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof Personalize) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof PersonalizeClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Personalize | PersonalizeClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-personalize/pagination/ListEventTrackersPaginator.ts b/clients/client-personalize/pagination/ListEventTrackersPaginator.ts new file mode 100644 index 0000000000000..a0ff493792d0b --- /dev/null +++ b/clients/client-personalize/pagination/ListEventTrackersPaginator.ts @@ -0,0 +1,51 @@ +import { Personalize } from "../Personalize"; +import { PersonalizeClient } from "../PersonalizeClient"; +import { + ListEventTrackersCommand, + ListEventTrackersCommandInput, + ListEventTrackersCommandOutput, +} from "../commands/ListEventTrackersCommand"; +import { PersonalizePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: PersonalizeClient, + input: ListEventTrackersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListEventTrackersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Personalize, + input: ListEventTrackersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listEventTrackers(input, ...args); +}; +export async function* listEventTrackersPaginate( + config: PersonalizePaginationConfiguration, + input: ListEventTrackersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListEventTrackersCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof Personalize) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof PersonalizeClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Personalize | PersonalizeClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-personalize/pagination/ListRecipesPaginator.ts b/clients/client-personalize/pagination/ListRecipesPaginator.ts new file mode 100644 index 0000000000000..669fe6987a4db --- /dev/null +++ b/clients/client-personalize/pagination/ListRecipesPaginator.ts @@ -0,0 +1,47 @@ +import { Personalize } from "../Personalize"; +import { PersonalizeClient } from "../PersonalizeClient"; +import { ListRecipesCommand, ListRecipesCommandInput, ListRecipesCommandOutput } from "../commands/ListRecipesCommand"; +import { PersonalizePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: PersonalizeClient, + input: ListRecipesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListRecipesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Personalize, + input: ListRecipesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listRecipes(input, ...args); +}; +export async function* listRecipesPaginate( + config: PersonalizePaginationConfiguration, + input: ListRecipesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListRecipesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof Personalize) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof PersonalizeClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Personalize | PersonalizeClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-personalize/pagination/ListSchemasPaginator.ts b/clients/client-personalize/pagination/ListSchemasPaginator.ts new file mode 100644 index 0000000000000..ac010d29c29d3 --- /dev/null +++ b/clients/client-personalize/pagination/ListSchemasPaginator.ts @@ -0,0 +1,47 @@ +import { Personalize } from "../Personalize"; +import { PersonalizeClient } from "../PersonalizeClient"; +import { ListSchemasCommand, ListSchemasCommandInput, ListSchemasCommandOutput } from "../commands/ListSchemasCommand"; +import { PersonalizePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: PersonalizeClient, + input: ListSchemasCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListSchemasCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Personalize, + input: ListSchemasCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listSchemas(input, ...args); +}; +export async function* listSchemasPaginate( + config: PersonalizePaginationConfiguration, + input: ListSchemasCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListSchemasCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof Personalize) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof PersonalizeClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Personalize | PersonalizeClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-personalize/pagination/ListSolutionVersionsPaginator.ts b/clients/client-personalize/pagination/ListSolutionVersionsPaginator.ts new file mode 100644 index 0000000000000..f2a9a6ab449a8 --- /dev/null +++ b/clients/client-personalize/pagination/ListSolutionVersionsPaginator.ts @@ -0,0 +1,51 @@ +import { Personalize } from "../Personalize"; +import { PersonalizeClient } from "../PersonalizeClient"; +import { + ListSolutionVersionsCommand, + ListSolutionVersionsCommandInput, + ListSolutionVersionsCommandOutput, +} from "../commands/ListSolutionVersionsCommand"; +import { PersonalizePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: PersonalizeClient, + input: ListSolutionVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListSolutionVersionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Personalize, + input: ListSolutionVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listSolutionVersions(input, ...args); +}; +export async function* listSolutionVersionsPaginate( + config: PersonalizePaginationConfiguration, + input: ListSolutionVersionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListSolutionVersionsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof Personalize) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof PersonalizeClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Personalize | PersonalizeClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-personalize/pagination/ListSolutionsPaginator.ts b/clients/client-personalize/pagination/ListSolutionsPaginator.ts new file mode 100644 index 0000000000000..d7e16a1b14f0f --- /dev/null +++ b/clients/client-personalize/pagination/ListSolutionsPaginator.ts @@ -0,0 +1,51 @@ +import { Personalize } from "../Personalize"; +import { PersonalizeClient } from "../PersonalizeClient"; +import { + ListSolutionsCommand, + ListSolutionsCommandInput, + ListSolutionsCommandOutput, +} from "../commands/ListSolutionsCommand"; +import { PersonalizePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: PersonalizeClient, + input: ListSolutionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListSolutionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Personalize, + input: ListSolutionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listSolutions(input, ...args); +}; +export async function* listSolutionsPaginate( + config: PersonalizePaginationConfiguration, + input: ListSolutionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListSolutionsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof Personalize) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof PersonalizeClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Personalize | PersonalizeClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-pinpoint-email/index.ts b/clients/client-pinpoint-email/index.ts index de491b55879aa..6354a566abcb3 100644 --- a/clients/client-pinpoint-email/index.ts +++ b/clients/client-pinpoint-email/index.ts @@ -15,16 +15,22 @@ export * from "./commands/GetConfigurationSetCommand"; export * from "./commands/GetConfigurationSetEventDestinationsCommand"; export * from "./commands/GetDedicatedIpCommand"; export * from "./commands/GetDedicatedIpsCommand"; +export * from "./pagination/GetDedicatedIpsPaginator"; export * from "./commands/GetDeliverabilityDashboardOptionsCommand"; export * from "./commands/GetDeliverabilityTestReportCommand"; export * from "./commands/GetDomainDeliverabilityCampaignCommand"; export * from "./commands/GetDomainStatisticsReportCommand"; export * from "./commands/GetEmailIdentityCommand"; export * from "./commands/ListConfigurationSetsCommand"; +export * from "./pagination/ListConfigurationSetsPaginator"; export * from "./commands/ListDedicatedIpPoolsCommand"; +export * from "./pagination/ListDedicatedIpPoolsPaginator"; export * from "./commands/ListDeliverabilityTestReportsCommand"; +export * from "./pagination/ListDeliverabilityTestReportsPaginator"; export * from "./commands/ListDomainDeliverabilityCampaignsCommand"; +export * from "./pagination/ListDomainDeliverabilityCampaignsPaginator"; export * from "./commands/ListEmailIdentitiesCommand"; +export * from "./pagination/ListEmailIdentitiesPaginator"; export * from "./commands/ListTagsForResourceCommand"; export * from "./commands/PutAccountDedicatedIpWarmupAttributesCommand"; export * from "./commands/PutAccountSendingAttributesCommand"; @@ -42,4 +48,5 @@ export * from "./commands/SendEmailCommand"; export * from "./commands/TagResourceCommand"; export * from "./commands/UntagResourceCommand"; export * from "./commands/UpdateConfigurationSetEventDestinationCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-pinpoint-email/pagination/GetDedicatedIpsPaginator.ts b/clients/client-pinpoint-email/pagination/GetDedicatedIpsPaginator.ts new file mode 100644 index 0000000000000..30674ca5c1e3d --- /dev/null +++ b/clients/client-pinpoint-email/pagination/GetDedicatedIpsPaginator.ts @@ -0,0 +1,51 @@ +import { PinpointEmail } from "../PinpointEmail"; +import { PinpointEmailClient } from "../PinpointEmailClient"; +import { + GetDedicatedIpsCommand, + GetDedicatedIpsCommandInput, + GetDedicatedIpsCommandOutput, +} from "../commands/GetDedicatedIpsCommand"; +import { PinpointEmailPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: PinpointEmailClient, + input: GetDedicatedIpsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetDedicatedIpsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: PinpointEmail, + input: GetDedicatedIpsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getDedicatedIps(input, ...args); +}; +export async function* getDedicatedIpsPaginate( + config: PinpointEmailPaginationConfiguration, + input: GetDedicatedIpsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetDedicatedIpsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["PageSize"] = config.pageSize; + if (config.client instanceof PinpointEmail) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof PinpointEmailClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected PinpointEmail | PinpointEmailClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-pinpoint-email/pagination/Interfaces.ts b/clients/client-pinpoint-email/pagination/Interfaces.ts new file mode 100644 index 0000000000000..c5adac1643750 --- /dev/null +++ b/clients/client-pinpoint-email/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { PinpointEmail } from "../PinpointEmail"; +import { PinpointEmailClient } from "../PinpointEmailClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface PinpointEmailPaginationConfiguration extends PaginationConfiguration { + client: PinpointEmail | PinpointEmailClient; +} diff --git a/clients/client-pinpoint-email/pagination/ListConfigurationSetsPaginator.ts b/clients/client-pinpoint-email/pagination/ListConfigurationSetsPaginator.ts new file mode 100644 index 0000000000000..97638b7a4076a --- /dev/null +++ b/clients/client-pinpoint-email/pagination/ListConfigurationSetsPaginator.ts @@ -0,0 +1,51 @@ +import { PinpointEmail } from "../PinpointEmail"; +import { PinpointEmailClient } from "../PinpointEmailClient"; +import { + ListConfigurationSetsCommand, + ListConfigurationSetsCommandInput, + ListConfigurationSetsCommandOutput, +} from "../commands/ListConfigurationSetsCommand"; +import { PinpointEmailPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: PinpointEmailClient, + input: ListConfigurationSetsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListConfigurationSetsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: PinpointEmail, + input: ListConfigurationSetsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listConfigurationSets(input, ...args); +}; +export async function* listConfigurationSetsPaginate( + config: PinpointEmailPaginationConfiguration, + input: ListConfigurationSetsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListConfigurationSetsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["PageSize"] = config.pageSize; + if (config.client instanceof PinpointEmail) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof PinpointEmailClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected PinpointEmail | PinpointEmailClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-pinpoint-email/pagination/ListDedicatedIpPoolsPaginator.ts b/clients/client-pinpoint-email/pagination/ListDedicatedIpPoolsPaginator.ts new file mode 100644 index 0000000000000..adf1b1414d7c1 --- /dev/null +++ b/clients/client-pinpoint-email/pagination/ListDedicatedIpPoolsPaginator.ts @@ -0,0 +1,51 @@ +import { PinpointEmail } from "../PinpointEmail"; +import { PinpointEmailClient } from "../PinpointEmailClient"; +import { + ListDedicatedIpPoolsCommand, + ListDedicatedIpPoolsCommandInput, + ListDedicatedIpPoolsCommandOutput, +} from "../commands/ListDedicatedIpPoolsCommand"; +import { PinpointEmailPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: PinpointEmailClient, + input: ListDedicatedIpPoolsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDedicatedIpPoolsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: PinpointEmail, + input: ListDedicatedIpPoolsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDedicatedIpPools(input, ...args); +}; +export async function* listDedicatedIpPoolsPaginate( + config: PinpointEmailPaginationConfiguration, + input: ListDedicatedIpPoolsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDedicatedIpPoolsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["PageSize"] = config.pageSize; + if (config.client instanceof PinpointEmail) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof PinpointEmailClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected PinpointEmail | PinpointEmailClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-pinpoint-email/pagination/ListDeliverabilityTestReportsPaginator.ts b/clients/client-pinpoint-email/pagination/ListDeliverabilityTestReportsPaginator.ts new file mode 100644 index 0000000000000..880c2a45e2bc8 --- /dev/null +++ b/clients/client-pinpoint-email/pagination/ListDeliverabilityTestReportsPaginator.ts @@ -0,0 +1,51 @@ +import { PinpointEmail } from "../PinpointEmail"; +import { PinpointEmailClient } from "../PinpointEmailClient"; +import { + ListDeliverabilityTestReportsCommand, + ListDeliverabilityTestReportsCommandInput, + ListDeliverabilityTestReportsCommandOutput, +} from "../commands/ListDeliverabilityTestReportsCommand"; +import { PinpointEmailPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: PinpointEmailClient, + input: ListDeliverabilityTestReportsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDeliverabilityTestReportsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: PinpointEmail, + input: ListDeliverabilityTestReportsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDeliverabilityTestReports(input, ...args); +}; +export async function* listDeliverabilityTestReportsPaginate( + config: PinpointEmailPaginationConfiguration, + input: ListDeliverabilityTestReportsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDeliverabilityTestReportsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["PageSize"] = config.pageSize; + if (config.client instanceof PinpointEmail) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof PinpointEmailClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected PinpointEmail | PinpointEmailClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-pinpoint-email/pagination/ListDomainDeliverabilityCampaignsPaginator.ts b/clients/client-pinpoint-email/pagination/ListDomainDeliverabilityCampaignsPaginator.ts new file mode 100644 index 0000000000000..b2014cf6eb989 --- /dev/null +++ b/clients/client-pinpoint-email/pagination/ListDomainDeliverabilityCampaignsPaginator.ts @@ -0,0 +1,51 @@ +import { PinpointEmail } from "../PinpointEmail"; +import { PinpointEmailClient } from "../PinpointEmailClient"; +import { + ListDomainDeliverabilityCampaignsCommand, + ListDomainDeliverabilityCampaignsCommandInput, + ListDomainDeliverabilityCampaignsCommandOutput, +} from "../commands/ListDomainDeliverabilityCampaignsCommand"; +import { PinpointEmailPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: PinpointEmailClient, + input: ListDomainDeliverabilityCampaignsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDomainDeliverabilityCampaignsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: PinpointEmail, + input: ListDomainDeliverabilityCampaignsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDomainDeliverabilityCampaigns(input, ...args); +}; +export async function* listDomainDeliverabilityCampaignsPaginate( + config: PinpointEmailPaginationConfiguration, + input: ListDomainDeliverabilityCampaignsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDomainDeliverabilityCampaignsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["PageSize"] = config.pageSize; + if (config.client instanceof PinpointEmail) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof PinpointEmailClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected PinpointEmail | PinpointEmailClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-pinpoint-email/pagination/ListEmailIdentitiesPaginator.ts b/clients/client-pinpoint-email/pagination/ListEmailIdentitiesPaginator.ts new file mode 100644 index 0000000000000..f513f4471fdd5 --- /dev/null +++ b/clients/client-pinpoint-email/pagination/ListEmailIdentitiesPaginator.ts @@ -0,0 +1,51 @@ +import { PinpointEmail } from "../PinpointEmail"; +import { PinpointEmailClient } from "../PinpointEmailClient"; +import { + ListEmailIdentitiesCommand, + ListEmailIdentitiesCommandInput, + ListEmailIdentitiesCommandOutput, +} from "../commands/ListEmailIdentitiesCommand"; +import { PinpointEmailPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: PinpointEmailClient, + input: ListEmailIdentitiesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListEmailIdentitiesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: PinpointEmail, + input: ListEmailIdentitiesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listEmailIdentities(input, ...args); +}; +export async function* listEmailIdentitiesPaginate( + config: PinpointEmailPaginationConfiguration, + input: ListEmailIdentitiesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListEmailIdentitiesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["PageSize"] = config.pageSize; + if (config.client instanceof PinpointEmail) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof PinpointEmailClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected PinpointEmail | PinpointEmailClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-polly/index.ts b/clients/client-polly/index.ts index cb44e7c155d61..cbb2178ef75a7 100644 --- a/clients/client-polly/index.ts +++ b/clients/client-polly/index.ts @@ -6,7 +6,9 @@ export * from "./commands/GetLexiconCommand"; export * from "./commands/GetSpeechSynthesisTaskCommand"; export * from "./commands/ListLexiconsCommand"; export * from "./commands/ListSpeechSynthesisTasksCommand"; +export * from "./pagination/ListSpeechSynthesisTasksPaginator"; export * from "./commands/PutLexiconCommand"; export * from "./commands/StartSpeechSynthesisTaskCommand"; export * from "./commands/SynthesizeSpeechCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-polly/pagination/Interfaces.ts b/clients/client-polly/pagination/Interfaces.ts new file mode 100644 index 0000000000000..d98fad0b125db --- /dev/null +++ b/clients/client-polly/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { Polly } from "../Polly"; +import { PollyClient } from "../PollyClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface PollyPaginationConfiguration extends PaginationConfiguration { + client: Polly | PollyClient; +} diff --git a/clients/client-polly/pagination/ListSpeechSynthesisTasksPaginator.ts b/clients/client-polly/pagination/ListSpeechSynthesisTasksPaginator.ts new file mode 100644 index 0000000000000..6307f0c18fe5d --- /dev/null +++ b/clients/client-polly/pagination/ListSpeechSynthesisTasksPaginator.ts @@ -0,0 +1,51 @@ +import { Polly } from "../Polly"; +import { PollyClient } from "../PollyClient"; +import { + ListSpeechSynthesisTasksCommand, + ListSpeechSynthesisTasksCommandInput, + ListSpeechSynthesisTasksCommandOutput, +} from "../commands/ListSpeechSynthesisTasksCommand"; +import { PollyPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: PollyClient, + input: ListSpeechSynthesisTasksCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListSpeechSynthesisTasksCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Polly, + input: ListSpeechSynthesisTasksCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listSpeechSynthesisTasks(input, ...args); +}; +export async function* listSpeechSynthesisTasksPaginate( + config: PollyPaginationConfiguration, + input: ListSpeechSynthesisTasksCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListSpeechSynthesisTasksCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Polly) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof PollyClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Polly | PollyClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-pricing/index.ts b/clients/client-pricing/index.ts index 5aa5ac6fea47c..6f4a6ff1a6e2f 100644 --- a/clients/client-pricing/index.ts +++ b/clients/client-pricing/index.ts @@ -1,6 +1,10 @@ export * from "./PricingClient"; export * from "./Pricing"; export * from "./commands/DescribeServicesCommand"; +export * from "./pagination/DescribeServicesPaginator"; export * from "./commands/GetAttributeValuesCommand"; +export * from "./pagination/GetAttributeValuesPaginator"; export * from "./commands/GetProductsCommand"; +export * from "./pagination/GetProductsPaginator"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-pricing/pagination/DescribeServicesPaginator.ts b/clients/client-pricing/pagination/DescribeServicesPaginator.ts new file mode 100644 index 0000000000000..afca81d5e2343 --- /dev/null +++ b/clients/client-pricing/pagination/DescribeServicesPaginator.ts @@ -0,0 +1,51 @@ +import { Pricing } from "../Pricing"; +import { PricingClient } from "../PricingClient"; +import { + DescribeServicesCommand, + DescribeServicesCommandInput, + DescribeServicesCommandOutput, +} from "../commands/DescribeServicesCommand"; +import { PricingPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: PricingClient, + input: DescribeServicesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeServicesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Pricing, + input: DescribeServicesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeServices(input, ...args); +}; +export async function* describeServicesPaginate( + config: PricingPaginationConfiguration, + input: DescribeServicesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeServicesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Pricing) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof PricingClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Pricing | PricingClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-pricing/pagination/GetAttributeValuesPaginator.ts b/clients/client-pricing/pagination/GetAttributeValuesPaginator.ts new file mode 100644 index 0000000000000..257c28fdc3d20 --- /dev/null +++ b/clients/client-pricing/pagination/GetAttributeValuesPaginator.ts @@ -0,0 +1,51 @@ +import { Pricing } from "../Pricing"; +import { PricingClient } from "../PricingClient"; +import { + GetAttributeValuesCommand, + GetAttributeValuesCommandInput, + GetAttributeValuesCommandOutput, +} from "../commands/GetAttributeValuesCommand"; +import { PricingPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: PricingClient, + input: GetAttributeValuesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetAttributeValuesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Pricing, + input: GetAttributeValuesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getAttributeValues(input, ...args); +}; +export async function* getAttributeValuesPaginate( + config: PricingPaginationConfiguration, + input: GetAttributeValuesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetAttributeValuesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Pricing) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof PricingClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Pricing | PricingClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-pricing/pagination/GetProductsPaginator.ts b/clients/client-pricing/pagination/GetProductsPaginator.ts new file mode 100644 index 0000000000000..30a8b934f6261 --- /dev/null +++ b/clients/client-pricing/pagination/GetProductsPaginator.ts @@ -0,0 +1,47 @@ +import { Pricing } from "../Pricing"; +import { PricingClient } from "../PricingClient"; +import { GetProductsCommand, GetProductsCommandInput, GetProductsCommandOutput } from "../commands/GetProductsCommand"; +import { PricingPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: PricingClient, + input: GetProductsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetProductsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Pricing, + input: GetProductsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getProducts(input, ...args); +}; +export async function* getProductsPaginate( + config: PricingPaginationConfiguration, + input: GetProductsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetProductsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Pricing) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof PricingClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Pricing | PricingClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-pricing/pagination/Interfaces.ts b/clients/client-pricing/pagination/Interfaces.ts new file mode 100644 index 0000000000000..4427c92e6ec22 --- /dev/null +++ b/clients/client-pricing/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { Pricing } from "../Pricing"; +import { PricingClient } from "../PricingClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface PricingPaginationConfiguration extends PaginationConfiguration { + client: Pricing | PricingClient; +} diff --git a/clients/client-qldb/index.ts b/clients/client-qldb/index.ts index 7caa0fa1dda7f..59b7806c47ea5 100644 --- a/clients/client-qldb/index.ts +++ b/clients/client-qldb/index.ts @@ -11,12 +11,17 @@ export * from "./commands/GetBlockCommand"; export * from "./commands/GetDigestCommand"; export * from "./commands/GetRevisionCommand"; export * from "./commands/ListJournalKinesisStreamsForLedgerCommand"; +export * from "./pagination/ListJournalKinesisStreamsForLedgerPaginator"; export * from "./commands/ListJournalS3ExportsCommand"; +export * from "./pagination/ListJournalS3ExportsPaginator"; export * from "./commands/ListJournalS3ExportsForLedgerCommand"; +export * from "./pagination/ListJournalS3ExportsForLedgerPaginator"; export * from "./commands/ListLedgersCommand"; +export * from "./pagination/ListLedgersPaginator"; export * from "./commands/ListTagsForResourceCommand"; export * from "./commands/StreamJournalToKinesisCommand"; export * from "./commands/TagResourceCommand"; export * from "./commands/UntagResourceCommand"; export * from "./commands/UpdateLedgerCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-qldb/pagination/Interfaces.ts b/clients/client-qldb/pagination/Interfaces.ts new file mode 100644 index 0000000000000..4d0dec184ed83 --- /dev/null +++ b/clients/client-qldb/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { QLDB } from "../QLDB"; +import { QLDBClient } from "../QLDBClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface QLDBPaginationConfiguration extends PaginationConfiguration { + client: QLDB | QLDBClient; +} diff --git a/clients/client-qldb/pagination/ListJournalKinesisStreamsForLedgerPaginator.ts b/clients/client-qldb/pagination/ListJournalKinesisStreamsForLedgerPaginator.ts new file mode 100644 index 0000000000000..cf6234b61255e --- /dev/null +++ b/clients/client-qldb/pagination/ListJournalKinesisStreamsForLedgerPaginator.ts @@ -0,0 +1,51 @@ +import { QLDB } from "../QLDB"; +import { QLDBClient } from "../QLDBClient"; +import { + ListJournalKinesisStreamsForLedgerCommand, + ListJournalKinesisStreamsForLedgerCommandInput, + ListJournalKinesisStreamsForLedgerCommandOutput, +} from "../commands/ListJournalKinesisStreamsForLedgerCommand"; +import { QLDBPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: QLDBClient, + input: ListJournalKinesisStreamsForLedgerCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListJournalKinesisStreamsForLedgerCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: QLDB, + input: ListJournalKinesisStreamsForLedgerCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listJournalKinesisStreamsForLedger(input, ...args); +}; +export async function* listJournalKinesisStreamsForLedgerPaginate( + config: QLDBPaginationConfiguration, + input: ListJournalKinesisStreamsForLedgerCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListJournalKinesisStreamsForLedgerCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof QLDB) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof QLDBClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected QLDB | QLDBClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-qldb/pagination/ListJournalS3ExportsForLedgerPaginator.ts b/clients/client-qldb/pagination/ListJournalS3ExportsForLedgerPaginator.ts new file mode 100644 index 0000000000000..1eca5b3e1a383 --- /dev/null +++ b/clients/client-qldb/pagination/ListJournalS3ExportsForLedgerPaginator.ts @@ -0,0 +1,51 @@ +import { QLDB } from "../QLDB"; +import { QLDBClient } from "../QLDBClient"; +import { + ListJournalS3ExportsForLedgerCommand, + ListJournalS3ExportsForLedgerCommandInput, + ListJournalS3ExportsForLedgerCommandOutput, +} from "../commands/ListJournalS3ExportsForLedgerCommand"; +import { QLDBPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: QLDBClient, + input: ListJournalS3ExportsForLedgerCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListJournalS3ExportsForLedgerCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: QLDB, + input: ListJournalS3ExportsForLedgerCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listJournalS3ExportsForLedger(input, ...args); +}; +export async function* listJournalS3ExportsForLedgerPaginate( + config: QLDBPaginationConfiguration, + input: ListJournalS3ExportsForLedgerCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListJournalS3ExportsForLedgerCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof QLDB) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof QLDBClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected QLDB | QLDBClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-qldb/pagination/ListJournalS3ExportsPaginator.ts b/clients/client-qldb/pagination/ListJournalS3ExportsPaginator.ts new file mode 100644 index 0000000000000..1092f25ebef98 --- /dev/null +++ b/clients/client-qldb/pagination/ListJournalS3ExportsPaginator.ts @@ -0,0 +1,51 @@ +import { QLDB } from "../QLDB"; +import { QLDBClient } from "../QLDBClient"; +import { + ListJournalS3ExportsCommand, + ListJournalS3ExportsCommandInput, + ListJournalS3ExportsCommandOutput, +} from "../commands/ListJournalS3ExportsCommand"; +import { QLDBPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: QLDBClient, + input: ListJournalS3ExportsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListJournalS3ExportsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: QLDB, + input: ListJournalS3ExportsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listJournalS3Exports(input, ...args); +}; +export async function* listJournalS3ExportsPaginate( + config: QLDBPaginationConfiguration, + input: ListJournalS3ExportsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListJournalS3ExportsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof QLDB) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof QLDBClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected QLDB | QLDBClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-qldb/pagination/ListLedgersPaginator.ts b/clients/client-qldb/pagination/ListLedgersPaginator.ts new file mode 100644 index 0000000000000..df4b4b4ccd858 --- /dev/null +++ b/clients/client-qldb/pagination/ListLedgersPaginator.ts @@ -0,0 +1,47 @@ +import { QLDB } from "../QLDB"; +import { QLDBClient } from "../QLDBClient"; +import { ListLedgersCommand, ListLedgersCommandInput, ListLedgersCommandOutput } from "../commands/ListLedgersCommand"; +import { QLDBPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: QLDBClient, + input: ListLedgersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListLedgersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: QLDB, + input: ListLedgersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listLedgers(input, ...args); +}; +export async function* listLedgersPaginate( + config: QLDBPaginationConfiguration, + input: ListLedgersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListLedgersCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof QLDB) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof QLDBClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected QLDB | QLDBClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-quicksight/index.ts b/clients/client-quicksight/index.ts index 2835f846f405e..350f3eb7ae3e7 100644 --- a/clients/client-quicksight/index.ts +++ b/clients/client-quicksight/index.ts @@ -50,19 +50,28 @@ export * from "./commands/DescribeUserCommand"; export * from "./commands/GetDashboardEmbedUrlCommand"; export * from "./commands/GetSessionEmbedUrlCommand"; export * from "./commands/ListDashboardsCommand"; +export * from "./pagination/ListDashboardsPaginator"; export * from "./commands/ListDashboardVersionsCommand"; +export * from "./pagination/ListDashboardVersionsPaginator"; export * from "./commands/ListDataSetsCommand"; +export * from "./pagination/ListDataSetsPaginator"; export * from "./commands/ListDataSourcesCommand"; +export * from "./pagination/ListDataSourcesPaginator"; export * from "./commands/ListGroupMembershipsCommand"; export * from "./commands/ListGroupsCommand"; export * from "./commands/ListIAMPolicyAssignmentsCommand"; export * from "./commands/ListIAMPolicyAssignmentsForUserCommand"; export * from "./commands/ListIngestionsCommand"; +export * from "./pagination/ListIngestionsPaginator"; export * from "./commands/ListNamespacesCommand"; +export * from "./pagination/ListNamespacesPaginator"; export * from "./commands/ListTagsForResourceCommand"; export * from "./commands/ListTemplateAliasesCommand"; +export * from "./pagination/ListTemplateAliasesPaginator"; export * from "./commands/ListTemplatesCommand"; +export * from "./pagination/ListTemplatesPaginator"; export * from "./commands/ListTemplateVersionsCommand"; +export * from "./pagination/ListTemplateVersionsPaginator"; export * from "./commands/ListThemeAliasesCommand"; export * from "./commands/ListThemesCommand"; export * from "./commands/ListThemeVersionsCommand"; @@ -70,6 +79,7 @@ export * from "./commands/ListUserGroupsCommand"; export * from "./commands/ListUsersCommand"; export * from "./commands/RegisterUserCommand"; export * from "./commands/SearchDashboardsCommand"; +export * from "./pagination/SearchDashboardsPaginator"; export * from "./commands/TagResourceCommand"; export * from "./commands/UntagResourceCommand"; export * from "./commands/UpdateAccountCustomizationCommand"; @@ -90,4 +100,5 @@ export * from "./commands/UpdateThemeCommand"; export * from "./commands/UpdateThemeAliasCommand"; export * from "./commands/UpdateThemePermissionsCommand"; export * from "./commands/UpdateUserCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-quicksight/pagination/Interfaces.ts b/clients/client-quicksight/pagination/Interfaces.ts new file mode 100644 index 0000000000000..371b6cd1c308e --- /dev/null +++ b/clients/client-quicksight/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { QuickSight } from "../QuickSight"; +import { QuickSightClient } from "../QuickSightClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface QuickSightPaginationConfiguration extends PaginationConfiguration { + client: QuickSight | QuickSightClient; +} diff --git a/clients/client-quicksight/pagination/ListDashboardVersionsPaginator.ts b/clients/client-quicksight/pagination/ListDashboardVersionsPaginator.ts new file mode 100644 index 0000000000000..5b5bfa9b0754e --- /dev/null +++ b/clients/client-quicksight/pagination/ListDashboardVersionsPaginator.ts @@ -0,0 +1,51 @@ +import { QuickSight } from "../QuickSight"; +import { QuickSightClient } from "../QuickSightClient"; +import { + ListDashboardVersionsCommand, + ListDashboardVersionsCommandInput, + ListDashboardVersionsCommandOutput, +} from "../commands/ListDashboardVersionsCommand"; +import { QuickSightPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: QuickSightClient, + input: ListDashboardVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDashboardVersionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: QuickSight, + input: ListDashboardVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDashboardVersions(input, ...args); +}; +export async function* listDashboardVersionsPaginate( + config: QuickSightPaginationConfiguration, + input: ListDashboardVersionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDashboardVersionsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof QuickSight) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof QuickSightClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected QuickSight | QuickSightClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-quicksight/pagination/ListDashboardsPaginator.ts b/clients/client-quicksight/pagination/ListDashboardsPaginator.ts new file mode 100644 index 0000000000000..34ea526154242 --- /dev/null +++ b/clients/client-quicksight/pagination/ListDashboardsPaginator.ts @@ -0,0 +1,51 @@ +import { QuickSight } from "../QuickSight"; +import { QuickSightClient } from "../QuickSightClient"; +import { + ListDashboardsCommand, + ListDashboardsCommandInput, + ListDashboardsCommandOutput, +} from "../commands/ListDashboardsCommand"; +import { QuickSightPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: QuickSightClient, + input: ListDashboardsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDashboardsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: QuickSight, + input: ListDashboardsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDashboards(input, ...args); +}; +export async function* listDashboardsPaginate( + config: QuickSightPaginationConfiguration, + input: ListDashboardsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDashboardsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof QuickSight) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof QuickSightClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected QuickSight | QuickSightClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-quicksight/pagination/ListDataSetsPaginator.ts b/clients/client-quicksight/pagination/ListDataSetsPaginator.ts new file mode 100644 index 0000000000000..bd9b2ce7d6890 --- /dev/null +++ b/clients/client-quicksight/pagination/ListDataSetsPaginator.ts @@ -0,0 +1,51 @@ +import { QuickSight } from "../QuickSight"; +import { QuickSightClient } from "../QuickSightClient"; +import { + ListDataSetsCommand, + ListDataSetsCommandInput, + ListDataSetsCommandOutput, +} from "../commands/ListDataSetsCommand"; +import { QuickSightPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: QuickSightClient, + input: ListDataSetsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDataSetsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: QuickSight, + input: ListDataSetsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDataSets(input, ...args); +}; +export async function* listDataSetsPaginate( + config: QuickSightPaginationConfiguration, + input: ListDataSetsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDataSetsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof QuickSight) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof QuickSightClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected QuickSight | QuickSightClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-quicksight/pagination/ListDataSourcesPaginator.ts b/clients/client-quicksight/pagination/ListDataSourcesPaginator.ts new file mode 100644 index 0000000000000..44b2df126d6d4 --- /dev/null +++ b/clients/client-quicksight/pagination/ListDataSourcesPaginator.ts @@ -0,0 +1,51 @@ +import { QuickSight } from "../QuickSight"; +import { QuickSightClient } from "../QuickSightClient"; +import { + ListDataSourcesCommand, + ListDataSourcesCommandInput, + ListDataSourcesCommandOutput, +} from "../commands/ListDataSourcesCommand"; +import { QuickSightPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: QuickSightClient, + input: ListDataSourcesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDataSourcesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: QuickSight, + input: ListDataSourcesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDataSources(input, ...args); +}; +export async function* listDataSourcesPaginate( + config: QuickSightPaginationConfiguration, + input: ListDataSourcesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDataSourcesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof QuickSight) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof QuickSightClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected QuickSight | QuickSightClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-quicksight/pagination/ListIngestionsPaginator.ts b/clients/client-quicksight/pagination/ListIngestionsPaginator.ts new file mode 100644 index 0000000000000..32c2b87991645 --- /dev/null +++ b/clients/client-quicksight/pagination/ListIngestionsPaginator.ts @@ -0,0 +1,51 @@ +import { QuickSight } from "../QuickSight"; +import { QuickSightClient } from "../QuickSightClient"; +import { + ListIngestionsCommand, + ListIngestionsCommandInput, + ListIngestionsCommandOutput, +} from "../commands/ListIngestionsCommand"; +import { QuickSightPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: QuickSightClient, + input: ListIngestionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListIngestionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: QuickSight, + input: ListIngestionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listIngestions(input, ...args); +}; +export async function* listIngestionsPaginate( + config: QuickSightPaginationConfiguration, + input: ListIngestionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListIngestionsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof QuickSight) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof QuickSightClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected QuickSight | QuickSightClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-quicksight/pagination/ListNamespacesPaginator.ts b/clients/client-quicksight/pagination/ListNamespacesPaginator.ts new file mode 100644 index 0000000000000..1c86751b76900 --- /dev/null +++ b/clients/client-quicksight/pagination/ListNamespacesPaginator.ts @@ -0,0 +1,51 @@ +import { QuickSight } from "../QuickSight"; +import { QuickSightClient } from "../QuickSightClient"; +import { + ListNamespacesCommand, + ListNamespacesCommandInput, + ListNamespacesCommandOutput, +} from "../commands/ListNamespacesCommand"; +import { QuickSightPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: QuickSightClient, + input: ListNamespacesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListNamespacesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: QuickSight, + input: ListNamespacesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listNamespaces(input, ...args); +}; +export async function* listNamespacesPaginate( + config: QuickSightPaginationConfiguration, + input: ListNamespacesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListNamespacesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof QuickSight) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof QuickSightClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected QuickSight | QuickSightClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-quicksight/pagination/ListTemplateAliasesPaginator.ts b/clients/client-quicksight/pagination/ListTemplateAliasesPaginator.ts new file mode 100644 index 0000000000000..1a64b5e1e1089 --- /dev/null +++ b/clients/client-quicksight/pagination/ListTemplateAliasesPaginator.ts @@ -0,0 +1,51 @@ +import { QuickSight } from "../QuickSight"; +import { QuickSightClient } from "../QuickSightClient"; +import { + ListTemplateAliasesCommand, + ListTemplateAliasesCommandInput, + ListTemplateAliasesCommandOutput, +} from "../commands/ListTemplateAliasesCommand"; +import { QuickSightPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: QuickSightClient, + input: ListTemplateAliasesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTemplateAliasesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: QuickSight, + input: ListTemplateAliasesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTemplateAliases(input, ...args); +}; +export async function* listTemplateAliasesPaginate( + config: QuickSightPaginationConfiguration, + input: ListTemplateAliasesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTemplateAliasesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof QuickSight) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof QuickSightClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected QuickSight | QuickSightClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-quicksight/pagination/ListTemplateVersionsPaginator.ts b/clients/client-quicksight/pagination/ListTemplateVersionsPaginator.ts new file mode 100644 index 0000000000000..55883f1ede422 --- /dev/null +++ b/clients/client-quicksight/pagination/ListTemplateVersionsPaginator.ts @@ -0,0 +1,51 @@ +import { QuickSight } from "../QuickSight"; +import { QuickSightClient } from "../QuickSightClient"; +import { + ListTemplateVersionsCommand, + ListTemplateVersionsCommandInput, + ListTemplateVersionsCommandOutput, +} from "../commands/ListTemplateVersionsCommand"; +import { QuickSightPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: QuickSightClient, + input: ListTemplateVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTemplateVersionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: QuickSight, + input: ListTemplateVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTemplateVersions(input, ...args); +}; +export async function* listTemplateVersionsPaginate( + config: QuickSightPaginationConfiguration, + input: ListTemplateVersionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTemplateVersionsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof QuickSight) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof QuickSightClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected QuickSight | QuickSightClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-quicksight/pagination/ListTemplatesPaginator.ts b/clients/client-quicksight/pagination/ListTemplatesPaginator.ts new file mode 100644 index 0000000000000..d85f3f630db23 --- /dev/null +++ b/clients/client-quicksight/pagination/ListTemplatesPaginator.ts @@ -0,0 +1,51 @@ +import { QuickSight } from "../QuickSight"; +import { QuickSightClient } from "../QuickSightClient"; +import { + ListTemplatesCommand, + ListTemplatesCommandInput, + ListTemplatesCommandOutput, +} from "../commands/ListTemplatesCommand"; +import { QuickSightPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: QuickSightClient, + input: ListTemplatesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTemplatesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: QuickSight, + input: ListTemplatesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTemplates(input, ...args); +}; +export async function* listTemplatesPaginate( + config: QuickSightPaginationConfiguration, + input: ListTemplatesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTemplatesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof QuickSight) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof QuickSightClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected QuickSight | QuickSightClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-quicksight/pagination/SearchDashboardsPaginator.ts b/clients/client-quicksight/pagination/SearchDashboardsPaginator.ts new file mode 100644 index 0000000000000..b0a4db3eb5e6e --- /dev/null +++ b/clients/client-quicksight/pagination/SearchDashboardsPaginator.ts @@ -0,0 +1,51 @@ +import { QuickSight } from "../QuickSight"; +import { QuickSightClient } from "../QuickSightClient"; +import { + SearchDashboardsCommand, + SearchDashboardsCommandInput, + SearchDashboardsCommandOutput, +} from "../commands/SearchDashboardsCommand"; +import { QuickSightPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: QuickSightClient, + input: SearchDashboardsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new SearchDashboardsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: QuickSight, + input: SearchDashboardsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.searchDashboards(input, ...args); +}; +export async function* searchDashboardsPaginate( + config: QuickSightPaginationConfiguration, + input: SearchDashboardsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: SearchDashboardsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof QuickSight) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof QuickSightClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected QuickSight | QuickSightClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-ram/index.ts b/clients/client-ram/index.ts index 5f622c2411110..e02a60c7a0b29 100644 --- a/clients/client-ram/index.ts +++ b/clients/client-ram/index.ts @@ -10,13 +10,20 @@ export * from "./commands/DisassociateResourceSharePermissionCommand"; export * from "./commands/EnableSharingWithAwsOrganizationCommand"; export * from "./commands/GetPermissionCommand"; export * from "./commands/GetResourcePoliciesCommand"; +export * from "./pagination/GetResourcePoliciesPaginator"; export * from "./commands/GetResourceShareAssociationsCommand"; +export * from "./pagination/GetResourceShareAssociationsPaginator"; export * from "./commands/GetResourceShareInvitationsCommand"; +export * from "./pagination/GetResourceShareInvitationsPaginator"; export * from "./commands/GetResourceSharesCommand"; +export * from "./pagination/GetResourceSharesPaginator"; export * from "./commands/ListPendingInvitationResourcesCommand"; +export * from "./pagination/ListPendingInvitationResourcesPaginator"; export * from "./commands/ListPermissionsCommand"; export * from "./commands/ListPrincipalsCommand"; +export * from "./pagination/ListPrincipalsPaginator"; export * from "./commands/ListResourcesCommand"; +export * from "./pagination/ListResourcesPaginator"; export * from "./commands/ListResourceSharePermissionsCommand"; export * from "./commands/ListResourceTypesCommand"; export * from "./commands/PromoteResourceShareCreatedFromPolicyCommand"; @@ -24,4 +31,5 @@ export * from "./commands/RejectResourceShareInvitationCommand"; export * from "./commands/TagResourceCommand"; export * from "./commands/UntagResourceCommand"; export * from "./commands/UpdateResourceShareCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-ram/pagination/GetResourcePoliciesPaginator.ts b/clients/client-ram/pagination/GetResourcePoliciesPaginator.ts new file mode 100644 index 0000000000000..40b0ef00c3214 --- /dev/null +++ b/clients/client-ram/pagination/GetResourcePoliciesPaginator.ts @@ -0,0 +1,51 @@ +import { RAM } from "../RAM"; +import { RAMClient } from "../RAMClient"; +import { + GetResourcePoliciesCommand, + GetResourcePoliciesCommandInput, + GetResourcePoliciesCommandOutput, +} from "../commands/GetResourcePoliciesCommand"; +import { RAMPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RAMClient, + input: GetResourcePoliciesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetResourcePoliciesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: RAM, + input: GetResourcePoliciesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getResourcePolicies(input, ...args); +}; +export async function* getResourcePoliciesPaginate( + config: RAMPaginationConfiguration, + input: GetResourcePoliciesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetResourcePoliciesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof RAM) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RAMClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected RAM | RAMClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-ram/pagination/GetResourceShareAssociationsPaginator.ts b/clients/client-ram/pagination/GetResourceShareAssociationsPaginator.ts new file mode 100644 index 0000000000000..ac8f7998c245b --- /dev/null +++ b/clients/client-ram/pagination/GetResourceShareAssociationsPaginator.ts @@ -0,0 +1,51 @@ +import { RAM } from "../RAM"; +import { RAMClient } from "../RAMClient"; +import { + GetResourceShareAssociationsCommand, + GetResourceShareAssociationsCommandInput, + GetResourceShareAssociationsCommandOutput, +} from "../commands/GetResourceShareAssociationsCommand"; +import { RAMPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RAMClient, + input: GetResourceShareAssociationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetResourceShareAssociationsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: RAM, + input: GetResourceShareAssociationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getResourceShareAssociations(input, ...args); +}; +export async function* getResourceShareAssociationsPaginate( + config: RAMPaginationConfiguration, + input: GetResourceShareAssociationsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetResourceShareAssociationsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof RAM) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RAMClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected RAM | RAMClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-ram/pagination/GetResourceShareInvitationsPaginator.ts b/clients/client-ram/pagination/GetResourceShareInvitationsPaginator.ts new file mode 100644 index 0000000000000..1e6317f182400 --- /dev/null +++ b/clients/client-ram/pagination/GetResourceShareInvitationsPaginator.ts @@ -0,0 +1,51 @@ +import { RAM } from "../RAM"; +import { RAMClient } from "../RAMClient"; +import { + GetResourceShareInvitationsCommand, + GetResourceShareInvitationsCommandInput, + GetResourceShareInvitationsCommandOutput, +} from "../commands/GetResourceShareInvitationsCommand"; +import { RAMPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RAMClient, + input: GetResourceShareInvitationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetResourceShareInvitationsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: RAM, + input: GetResourceShareInvitationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getResourceShareInvitations(input, ...args); +}; +export async function* getResourceShareInvitationsPaginate( + config: RAMPaginationConfiguration, + input: GetResourceShareInvitationsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetResourceShareInvitationsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof RAM) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RAMClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected RAM | RAMClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-ram/pagination/GetResourceSharesPaginator.ts b/clients/client-ram/pagination/GetResourceSharesPaginator.ts new file mode 100644 index 0000000000000..2e8271fae67c3 --- /dev/null +++ b/clients/client-ram/pagination/GetResourceSharesPaginator.ts @@ -0,0 +1,51 @@ +import { RAM } from "../RAM"; +import { RAMClient } from "../RAMClient"; +import { + GetResourceSharesCommand, + GetResourceSharesCommandInput, + GetResourceSharesCommandOutput, +} from "../commands/GetResourceSharesCommand"; +import { RAMPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RAMClient, + input: GetResourceSharesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetResourceSharesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: RAM, + input: GetResourceSharesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getResourceShares(input, ...args); +}; +export async function* getResourceSharesPaginate( + config: RAMPaginationConfiguration, + input: GetResourceSharesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetResourceSharesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof RAM) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RAMClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected RAM | RAMClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-ram/pagination/Interfaces.ts b/clients/client-ram/pagination/Interfaces.ts new file mode 100644 index 0000000000000..2e2e5d3d9111e --- /dev/null +++ b/clients/client-ram/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { RAM } from "../RAM"; +import { RAMClient } from "../RAMClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface RAMPaginationConfiguration extends PaginationConfiguration { + client: RAM | RAMClient; +} diff --git a/clients/client-ram/pagination/ListPendingInvitationResourcesPaginator.ts b/clients/client-ram/pagination/ListPendingInvitationResourcesPaginator.ts new file mode 100644 index 0000000000000..272bc5121d689 --- /dev/null +++ b/clients/client-ram/pagination/ListPendingInvitationResourcesPaginator.ts @@ -0,0 +1,51 @@ +import { RAM } from "../RAM"; +import { RAMClient } from "../RAMClient"; +import { + ListPendingInvitationResourcesCommand, + ListPendingInvitationResourcesCommandInput, + ListPendingInvitationResourcesCommandOutput, +} from "../commands/ListPendingInvitationResourcesCommand"; +import { RAMPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RAMClient, + input: ListPendingInvitationResourcesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListPendingInvitationResourcesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: RAM, + input: ListPendingInvitationResourcesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listPendingInvitationResources(input, ...args); +}; +export async function* listPendingInvitationResourcesPaginate( + config: RAMPaginationConfiguration, + input: ListPendingInvitationResourcesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListPendingInvitationResourcesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof RAM) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RAMClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected RAM | RAMClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-ram/pagination/ListPrincipalsPaginator.ts b/clients/client-ram/pagination/ListPrincipalsPaginator.ts new file mode 100644 index 0000000000000..ac5bec930ff37 --- /dev/null +++ b/clients/client-ram/pagination/ListPrincipalsPaginator.ts @@ -0,0 +1,51 @@ +import { RAM } from "../RAM"; +import { RAMClient } from "../RAMClient"; +import { + ListPrincipalsCommand, + ListPrincipalsCommandInput, + ListPrincipalsCommandOutput, +} from "../commands/ListPrincipalsCommand"; +import { RAMPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RAMClient, + input: ListPrincipalsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListPrincipalsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: RAM, + input: ListPrincipalsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listPrincipals(input, ...args); +}; +export async function* listPrincipalsPaginate( + config: RAMPaginationConfiguration, + input: ListPrincipalsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListPrincipalsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof RAM) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RAMClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected RAM | RAMClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-ram/pagination/ListResourcesPaginator.ts b/clients/client-ram/pagination/ListResourcesPaginator.ts new file mode 100644 index 0000000000000..1b175a6e0cb36 --- /dev/null +++ b/clients/client-ram/pagination/ListResourcesPaginator.ts @@ -0,0 +1,51 @@ +import { RAM } from "../RAM"; +import { RAMClient } from "../RAMClient"; +import { + ListResourcesCommand, + ListResourcesCommandInput, + ListResourcesCommandOutput, +} from "../commands/ListResourcesCommand"; +import { RAMPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RAMClient, + input: ListResourcesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListResourcesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: RAM, + input: ListResourcesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listResources(input, ...args); +}; +export async function* listResourcesPaginate( + config: RAMPaginationConfiguration, + input: ListResourcesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListResourcesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof RAM) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RAMClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected RAM | RAMClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-rds/index.ts b/clients/client-rds/index.ts index ce0e1a1292e71..928cc0b1b7a0b 100644 --- a/clients/client-rds/index.ts +++ b/clients/client-rds/index.ts @@ -47,42 +47,74 @@ export * from "./commands/DeleteOptionGroupCommand"; export * from "./commands/DeregisterDBProxyTargetsCommand"; export * from "./commands/DescribeAccountAttributesCommand"; export * from "./commands/DescribeCertificatesCommand"; +export * from "./pagination/DescribeCertificatesPaginator"; export * from "./commands/DescribeCustomAvailabilityZonesCommand"; +export * from "./pagination/DescribeCustomAvailabilityZonesPaginator"; export * from "./commands/DescribeDBClusterBacktracksCommand"; +export * from "./pagination/DescribeDBClusterBacktracksPaginator"; export * from "./commands/DescribeDBClusterEndpointsCommand"; +export * from "./pagination/DescribeDBClusterEndpointsPaginator"; export * from "./commands/DescribeDBClusterParameterGroupsCommand"; +export * from "./pagination/DescribeDBClusterParameterGroupsPaginator"; export * from "./commands/DescribeDBClusterParametersCommand"; +export * from "./pagination/DescribeDBClusterParametersPaginator"; export * from "./commands/DescribeDBClustersCommand"; +export * from "./pagination/DescribeDBClustersPaginator"; export * from "./commands/DescribeDBClusterSnapshotAttributesCommand"; export * from "./commands/DescribeDBClusterSnapshotsCommand"; +export * from "./pagination/DescribeDBClusterSnapshotsPaginator"; export * from "./commands/DescribeDBEngineVersionsCommand"; +export * from "./pagination/DescribeDBEngineVersionsPaginator"; export * from "./commands/DescribeDBInstanceAutomatedBackupsCommand"; +export * from "./pagination/DescribeDBInstanceAutomatedBackupsPaginator"; export * from "./commands/DescribeDBInstancesCommand"; +export * from "./pagination/DescribeDBInstancesPaginator"; export * from "./commands/DescribeDBLogFilesCommand"; +export * from "./pagination/DescribeDBLogFilesPaginator"; export * from "./commands/DescribeDBParameterGroupsCommand"; +export * from "./pagination/DescribeDBParameterGroupsPaginator"; export * from "./commands/DescribeDBParametersCommand"; +export * from "./pagination/DescribeDBParametersPaginator"; export * from "./commands/DescribeDBProxiesCommand"; +export * from "./pagination/DescribeDBProxiesPaginator"; export * from "./commands/DescribeDBProxyTargetGroupsCommand"; +export * from "./pagination/DescribeDBProxyTargetGroupsPaginator"; export * from "./commands/DescribeDBProxyTargetsCommand"; +export * from "./pagination/DescribeDBProxyTargetsPaginator"; export * from "./commands/DescribeDBSecurityGroupsCommand"; +export * from "./pagination/DescribeDBSecurityGroupsPaginator"; export * from "./commands/DescribeDBSnapshotAttributesCommand"; export * from "./commands/DescribeDBSnapshotsCommand"; +export * from "./pagination/DescribeDBSnapshotsPaginator"; export * from "./commands/DescribeDBSubnetGroupsCommand"; +export * from "./pagination/DescribeDBSubnetGroupsPaginator"; export * from "./commands/DescribeEngineDefaultClusterParametersCommand"; export * from "./commands/DescribeEngineDefaultParametersCommand"; export * from "./commands/DescribeEventCategoriesCommand"; export * from "./commands/DescribeEventsCommand"; +export * from "./pagination/DescribeEventsPaginator"; export * from "./commands/DescribeEventSubscriptionsCommand"; +export * from "./pagination/DescribeEventSubscriptionsPaginator"; export * from "./commands/DescribeExportTasksCommand"; +export * from "./pagination/DescribeExportTasksPaginator"; export * from "./commands/DescribeGlobalClustersCommand"; +export * from "./pagination/DescribeGlobalClustersPaginator"; export * from "./commands/DescribeInstallationMediaCommand"; +export * from "./pagination/DescribeInstallationMediaPaginator"; export * from "./commands/DescribeOptionGroupOptionsCommand"; +export * from "./pagination/DescribeOptionGroupOptionsPaginator"; export * from "./commands/DescribeOptionGroupsCommand"; +export * from "./pagination/DescribeOptionGroupsPaginator"; export * from "./commands/DescribeOrderableDBInstanceOptionsCommand"; +export * from "./pagination/DescribeOrderableDBInstanceOptionsPaginator"; export * from "./commands/DescribePendingMaintenanceActionsCommand"; +export * from "./pagination/DescribePendingMaintenanceActionsPaginator"; export * from "./commands/DescribeReservedDBInstancesCommand"; +export * from "./pagination/DescribeReservedDBInstancesPaginator"; export * from "./commands/DescribeReservedDBInstancesOfferingsCommand"; +export * from "./pagination/DescribeReservedDBInstancesOfferingsPaginator"; export * from "./commands/DescribeSourceRegionsCommand"; +export * from "./pagination/DescribeSourceRegionsPaginator"; export * from "./commands/DescribeValidDBInstanceModificationsCommand"; export * from "./commands/DownloadDBLogFilePortionCommand"; export * from "./commands/FailoverDBClusterCommand"; @@ -130,4 +162,5 @@ export * from "./commands/StartExportTaskCommand"; export * from "./commands/StopActivityStreamCommand"; export * from "./commands/StopDBClusterCommand"; export * from "./commands/StopDBInstanceCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-rds/pagination/DescribeCertificatesPaginator.ts b/clients/client-rds/pagination/DescribeCertificatesPaginator.ts new file mode 100644 index 0000000000000..1352000ce578b --- /dev/null +++ b/clients/client-rds/pagination/DescribeCertificatesPaginator.ts @@ -0,0 +1,51 @@ +import { RDS } from "../RDS"; +import { RDSClient } from "../RDSClient"; +import { + DescribeCertificatesCommand, + DescribeCertificatesCommandInput, + DescribeCertificatesCommandOutput, +} from "../commands/DescribeCertificatesCommand"; +import { RDSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RDSClient, + input: DescribeCertificatesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeCertificatesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: RDS, + input: DescribeCertificatesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeCertificates(input, ...args); +}; +export async function* describeCertificatesPaginate( + config: RDSPaginationConfiguration, + input: DescribeCertificatesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeCertificatesCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof RDS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RDSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected RDS | RDSClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-rds/pagination/DescribeCustomAvailabilityZonesPaginator.ts b/clients/client-rds/pagination/DescribeCustomAvailabilityZonesPaginator.ts new file mode 100644 index 0000000000000..215c698316f88 --- /dev/null +++ b/clients/client-rds/pagination/DescribeCustomAvailabilityZonesPaginator.ts @@ -0,0 +1,51 @@ +import { RDS } from "../RDS"; +import { RDSClient } from "../RDSClient"; +import { + DescribeCustomAvailabilityZonesCommand, + DescribeCustomAvailabilityZonesCommandInput, + DescribeCustomAvailabilityZonesCommandOutput, +} from "../commands/DescribeCustomAvailabilityZonesCommand"; +import { RDSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RDSClient, + input: DescribeCustomAvailabilityZonesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeCustomAvailabilityZonesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: RDS, + input: DescribeCustomAvailabilityZonesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeCustomAvailabilityZones(input, ...args); +}; +export async function* describeCustomAvailabilityZonesPaginate( + config: RDSPaginationConfiguration, + input: DescribeCustomAvailabilityZonesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeCustomAvailabilityZonesCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof RDS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RDSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected RDS | RDSClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-rds/pagination/DescribeDBClusterBacktracksPaginator.ts b/clients/client-rds/pagination/DescribeDBClusterBacktracksPaginator.ts new file mode 100644 index 0000000000000..5c98aa62c6ca0 --- /dev/null +++ b/clients/client-rds/pagination/DescribeDBClusterBacktracksPaginator.ts @@ -0,0 +1,51 @@ +import { RDS } from "../RDS"; +import { RDSClient } from "../RDSClient"; +import { + DescribeDBClusterBacktracksCommand, + DescribeDBClusterBacktracksCommandInput, + DescribeDBClusterBacktracksCommandOutput, +} from "../commands/DescribeDBClusterBacktracksCommand"; +import { RDSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RDSClient, + input: DescribeDBClusterBacktracksCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeDBClusterBacktracksCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: RDS, + input: DescribeDBClusterBacktracksCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeDBClusterBacktracks(input, ...args); +}; +export async function* describeDBClusterBacktracksPaginate( + config: RDSPaginationConfiguration, + input: DescribeDBClusterBacktracksCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeDBClusterBacktracksCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof RDS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RDSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected RDS | RDSClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-rds/pagination/DescribeDBClusterEndpointsPaginator.ts b/clients/client-rds/pagination/DescribeDBClusterEndpointsPaginator.ts new file mode 100644 index 0000000000000..7ce13c249ba7d --- /dev/null +++ b/clients/client-rds/pagination/DescribeDBClusterEndpointsPaginator.ts @@ -0,0 +1,51 @@ +import { RDS } from "../RDS"; +import { RDSClient } from "../RDSClient"; +import { + DescribeDBClusterEndpointsCommand, + DescribeDBClusterEndpointsCommandInput, + DescribeDBClusterEndpointsCommandOutput, +} from "../commands/DescribeDBClusterEndpointsCommand"; +import { RDSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RDSClient, + input: DescribeDBClusterEndpointsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeDBClusterEndpointsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: RDS, + input: DescribeDBClusterEndpointsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeDBClusterEndpoints(input, ...args); +}; +export async function* describeDBClusterEndpointsPaginate( + config: RDSPaginationConfiguration, + input: DescribeDBClusterEndpointsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeDBClusterEndpointsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof RDS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RDSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected RDS | RDSClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-rds/pagination/DescribeDBClusterParameterGroupsPaginator.ts b/clients/client-rds/pagination/DescribeDBClusterParameterGroupsPaginator.ts new file mode 100644 index 0000000000000..b9cd7694cd606 --- /dev/null +++ b/clients/client-rds/pagination/DescribeDBClusterParameterGroupsPaginator.ts @@ -0,0 +1,51 @@ +import { RDS } from "../RDS"; +import { RDSClient } from "../RDSClient"; +import { + DescribeDBClusterParameterGroupsCommand, + DescribeDBClusterParameterGroupsCommandInput, + DescribeDBClusterParameterGroupsCommandOutput, +} from "../commands/DescribeDBClusterParameterGroupsCommand"; +import { RDSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RDSClient, + input: DescribeDBClusterParameterGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeDBClusterParameterGroupsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: RDS, + input: DescribeDBClusterParameterGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeDBClusterParameterGroups(input, ...args); +}; +export async function* describeDBClusterParameterGroupsPaginate( + config: RDSPaginationConfiguration, + input: DescribeDBClusterParameterGroupsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeDBClusterParameterGroupsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof RDS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RDSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected RDS | RDSClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-rds/pagination/DescribeDBClusterParametersPaginator.ts b/clients/client-rds/pagination/DescribeDBClusterParametersPaginator.ts new file mode 100644 index 0000000000000..5e33a94d2e1dc --- /dev/null +++ b/clients/client-rds/pagination/DescribeDBClusterParametersPaginator.ts @@ -0,0 +1,51 @@ +import { RDS } from "../RDS"; +import { RDSClient } from "../RDSClient"; +import { + DescribeDBClusterParametersCommand, + DescribeDBClusterParametersCommandInput, + DescribeDBClusterParametersCommandOutput, +} from "../commands/DescribeDBClusterParametersCommand"; +import { RDSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RDSClient, + input: DescribeDBClusterParametersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeDBClusterParametersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: RDS, + input: DescribeDBClusterParametersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeDBClusterParameters(input, ...args); +}; +export async function* describeDBClusterParametersPaginate( + config: RDSPaginationConfiguration, + input: DescribeDBClusterParametersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeDBClusterParametersCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof RDS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RDSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected RDS | RDSClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-rds/pagination/DescribeDBClusterSnapshotsPaginator.ts b/clients/client-rds/pagination/DescribeDBClusterSnapshotsPaginator.ts new file mode 100644 index 0000000000000..960d48ce9e907 --- /dev/null +++ b/clients/client-rds/pagination/DescribeDBClusterSnapshotsPaginator.ts @@ -0,0 +1,51 @@ +import { RDS } from "../RDS"; +import { RDSClient } from "../RDSClient"; +import { + DescribeDBClusterSnapshotsCommand, + DescribeDBClusterSnapshotsCommandInput, + DescribeDBClusterSnapshotsCommandOutput, +} from "../commands/DescribeDBClusterSnapshotsCommand"; +import { RDSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RDSClient, + input: DescribeDBClusterSnapshotsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeDBClusterSnapshotsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: RDS, + input: DescribeDBClusterSnapshotsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeDBClusterSnapshots(input, ...args); +}; +export async function* describeDBClusterSnapshotsPaginate( + config: RDSPaginationConfiguration, + input: DescribeDBClusterSnapshotsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeDBClusterSnapshotsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof RDS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RDSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected RDS | RDSClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-rds/pagination/DescribeDBClustersPaginator.ts b/clients/client-rds/pagination/DescribeDBClustersPaginator.ts new file mode 100644 index 0000000000000..0cd79a1a05152 --- /dev/null +++ b/clients/client-rds/pagination/DescribeDBClustersPaginator.ts @@ -0,0 +1,51 @@ +import { RDS } from "../RDS"; +import { RDSClient } from "../RDSClient"; +import { + DescribeDBClustersCommand, + DescribeDBClustersCommandInput, + DescribeDBClustersCommandOutput, +} from "../commands/DescribeDBClustersCommand"; +import { RDSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RDSClient, + input: DescribeDBClustersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeDBClustersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: RDS, + input: DescribeDBClustersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeDBClusters(input, ...args); +}; +export async function* describeDBClustersPaginate( + config: RDSPaginationConfiguration, + input: DescribeDBClustersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeDBClustersCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof RDS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RDSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected RDS | RDSClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-rds/pagination/DescribeDBEngineVersionsPaginator.ts b/clients/client-rds/pagination/DescribeDBEngineVersionsPaginator.ts new file mode 100644 index 0000000000000..70356ef9db2ce --- /dev/null +++ b/clients/client-rds/pagination/DescribeDBEngineVersionsPaginator.ts @@ -0,0 +1,51 @@ +import { RDS } from "../RDS"; +import { RDSClient } from "../RDSClient"; +import { + DescribeDBEngineVersionsCommand, + DescribeDBEngineVersionsCommandInput, + DescribeDBEngineVersionsCommandOutput, +} from "../commands/DescribeDBEngineVersionsCommand"; +import { RDSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RDSClient, + input: DescribeDBEngineVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeDBEngineVersionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: RDS, + input: DescribeDBEngineVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeDBEngineVersions(input, ...args); +}; +export async function* describeDBEngineVersionsPaginate( + config: RDSPaginationConfiguration, + input: DescribeDBEngineVersionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeDBEngineVersionsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof RDS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RDSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected RDS | RDSClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-rds/pagination/DescribeDBInstanceAutomatedBackupsPaginator.ts b/clients/client-rds/pagination/DescribeDBInstanceAutomatedBackupsPaginator.ts new file mode 100644 index 0000000000000..e0cdfd829fad8 --- /dev/null +++ b/clients/client-rds/pagination/DescribeDBInstanceAutomatedBackupsPaginator.ts @@ -0,0 +1,51 @@ +import { RDS } from "../RDS"; +import { RDSClient } from "../RDSClient"; +import { + DescribeDBInstanceAutomatedBackupsCommand, + DescribeDBInstanceAutomatedBackupsCommandInput, + DescribeDBInstanceAutomatedBackupsCommandOutput, +} from "../commands/DescribeDBInstanceAutomatedBackupsCommand"; +import { RDSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RDSClient, + input: DescribeDBInstanceAutomatedBackupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeDBInstanceAutomatedBackupsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: RDS, + input: DescribeDBInstanceAutomatedBackupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeDBInstanceAutomatedBackups(input, ...args); +}; +export async function* describeDBInstanceAutomatedBackupsPaginate( + config: RDSPaginationConfiguration, + input: DescribeDBInstanceAutomatedBackupsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeDBInstanceAutomatedBackupsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof RDS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RDSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected RDS | RDSClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-rds/pagination/DescribeDBInstancesPaginator.ts b/clients/client-rds/pagination/DescribeDBInstancesPaginator.ts new file mode 100644 index 0000000000000..eaf4de062a723 --- /dev/null +++ b/clients/client-rds/pagination/DescribeDBInstancesPaginator.ts @@ -0,0 +1,51 @@ +import { RDS } from "../RDS"; +import { RDSClient } from "../RDSClient"; +import { + DescribeDBInstancesCommand, + DescribeDBInstancesCommandInput, + DescribeDBInstancesCommandOutput, +} from "../commands/DescribeDBInstancesCommand"; +import { RDSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RDSClient, + input: DescribeDBInstancesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeDBInstancesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: RDS, + input: DescribeDBInstancesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeDBInstances(input, ...args); +}; +export async function* describeDBInstancesPaginate( + config: RDSPaginationConfiguration, + input: DescribeDBInstancesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeDBInstancesCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof RDS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RDSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected RDS | RDSClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-rds/pagination/DescribeDBLogFilesPaginator.ts b/clients/client-rds/pagination/DescribeDBLogFilesPaginator.ts new file mode 100644 index 0000000000000..fee4e365d3c17 --- /dev/null +++ b/clients/client-rds/pagination/DescribeDBLogFilesPaginator.ts @@ -0,0 +1,51 @@ +import { RDS } from "../RDS"; +import { RDSClient } from "../RDSClient"; +import { + DescribeDBLogFilesCommand, + DescribeDBLogFilesCommandInput, + DescribeDBLogFilesCommandOutput, +} from "../commands/DescribeDBLogFilesCommand"; +import { RDSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RDSClient, + input: DescribeDBLogFilesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeDBLogFilesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: RDS, + input: DescribeDBLogFilesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeDBLogFiles(input, ...args); +}; +export async function* describeDBLogFilesPaginate( + config: RDSPaginationConfiguration, + input: DescribeDBLogFilesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeDBLogFilesCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof RDS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RDSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected RDS | RDSClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-rds/pagination/DescribeDBParameterGroupsPaginator.ts b/clients/client-rds/pagination/DescribeDBParameterGroupsPaginator.ts new file mode 100644 index 0000000000000..5785bff61e516 --- /dev/null +++ b/clients/client-rds/pagination/DescribeDBParameterGroupsPaginator.ts @@ -0,0 +1,51 @@ +import { RDS } from "../RDS"; +import { RDSClient } from "../RDSClient"; +import { + DescribeDBParameterGroupsCommand, + DescribeDBParameterGroupsCommandInput, + DescribeDBParameterGroupsCommandOutput, +} from "../commands/DescribeDBParameterGroupsCommand"; +import { RDSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RDSClient, + input: DescribeDBParameterGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeDBParameterGroupsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: RDS, + input: DescribeDBParameterGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeDBParameterGroups(input, ...args); +}; +export async function* describeDBParameterGroupsPaginate( + config: RDSPaginationConfiguration, + input: DescribeDBParameterGroupsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeDBParameterGroupsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof RDS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RDSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected RDS | RDSClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-rds/pagination/DescribeDBParametersPaginator.ts b/clients/client-rds/pagination/DescribeDBParametersPaginator.ts new file mode 100644 index 0000000000000..e8d913cf43413 --- /dev/null +++ b/clients/client-rds/pagination/DescribeDBParametersPaginator.ts @@ -0,0 +1,51 @@ +import { RDS } from "../RDS"; +import { RDSClient } from "../RDSClient"; +import { + DescribeDBParametersCommand, + DescribeDBParametersCommandInput, + DescribeDBParametersCommandOutput, +} from "../commands/DescribeDBParametersCommand"; +import { RDSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RDSClient, + input: DescribeDBParametersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeDBParametersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: RDS, + input: DescribeDBParametersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeDBParameters(input, ...args); +}; +export async function* describeDBParametersPaginate( + config: RDSPaginationConfiguration, + input: DescribeDBParametersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeDBParametersCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof RDS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RDSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected RDS | RDSClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-rds/pagination/DescribeDBProxiesPaginator.ts b/clients/client-rds/pagination/DescribeDBProxiesPaginator.ts new file mode 100644 index 0000000000000..af537e6c0e5bc --- /dev/null +++ b/clients/client-rds/pagination/DescribeDBProxiesPaginator.ts @@ -0,0 +1,51 @@ +import { RDS } from "../RDS"; +import { RDSClient } from "../RDSClient"; +import { + DescribeDBProxiesCommand, + DescribeDBProxiesCommandInput, + DescribeDBProxiesCommandOutput, +} from "../commands/DescribeDBProxiesCommand"; +import { RDSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RDSClient, + input: DescribeDBProxiesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeDBProxiesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: RDS, + input: DescribeDBProxiesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeDBProxies(input, ...args); +}; +export async function* describeDBProxiesPaginate( + config: RDSPaginationConfiguration, + input: DescribeDBProxiesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeDBProxiesCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof RDS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RDSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected RDS | RDSClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-rds/pagination/DescribeDBProxyTargetGroupsPaginator.ts b/clients/client-rds/pagination/DescribeDBProxyTargetGroupsPaginator.ts new file mode 100644 index 0000000000000..3c3eb36afa05c --- /dev/null +++ b/clients/client-rds/pagination/DescribeDBProxyTargetGroupsPaginator.ts @@ -0,0 +1,51 @@ +import { RDS } from "../RDS"; +import { RDSClient } from "../RDSClient"; +import { + DescribeDBProxyTargetGroupsCommand, + DescribeDBProxyTargetGroupsCommandInput, + DescribeDBProxyTargetGroupsCommandOutput, +} from "../commands/DescribeDBProxyTargetGroupsCommand"; +import { RDSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RDSClient, + input: DescribeDBProxyTargetGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeDBProxyTargetGroupsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: RDS, + input: DescribeDBProxyTargetGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeDBProxyTargetGroups(input, ...args); +}; +export async function* describeDBProxyTargetGroupsPaginate( + config: RDSPaginationConfiguration, + input: DescribeDBProxyTargetGroupsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeDBProxyTargetGroupsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof RDS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RDSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected RDS | RDSClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-rds/pagination/DescribeDBProxyTargetsPaginator.ts b/clients/client-rds/pagination/DescribeDBProxyTargetsPaginator.ts new file mode 100644 index 0000000000000..9d46b3a54b177 --- /dev/null +++ b/clients/client-rds/pagination/DescribeDBProxyTargetsPaginator.ts @@ -0,0 +1,51 @@ +import { RDS } from "../RDS"; +import { RDSClient } from "../RDSClient"; +import { + DescribeDBProxyTargetsCommand, + DescribeDBProxyTargetsCommandInput, + DescribeDBProxyTargetsCommandOutput, +} from "../commands/DescribeDBProxyTargetsCommand"; +import { RDSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RDSClient, + input: DescribeDBProxyTargetsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeDBProxyTargetsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: RDS, + input: DescribeDBProxyTargetsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeDBProxyTargets(input, ...args); +}; +export async function* describeDBProxyTargetsPaginate( + config: RDSPaginationConfiguration, + input: DescribeDBProxyTargetsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeDBProxyTargetsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof RDS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RDSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected RDS | RDSClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-rds/pagination/DescribeDBSecurityGroupsPaginator.ts b/clients/client-rds/pagination/DescribeDBSecurityGroupsPaginator.ts new file mode 100644 index 0000000000000..285a550b0feae --- /dev/null +++ b/clients/client-rds/pagination/DescribeDBSecurityGroupsPaginator.ts @@ -0,0 +1,51 @@ +import { RDS } from "../RDS"; +import { RDSClient } from "../RDSClient"; +import { + DescribeDBSecurityGroupsCommand, + DescribeDBSecurityGroupsCommandInput, + DescribeDBSecurityGroupsCommandOutput, +} from "../commands/DescribeDBSecurityGroupsCommand"; +import { RDSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RDSClient, + input: DescribeDBSecurityGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeDBSecurityGroupsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: RDS, + input: DescribeDBSecurityGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeDBSecurityGroups(input, ...args); +}; +export async function* describeDBSecurityGroupsPaginate( + config: RDSPaginationConfiguration, + input: DescribeDBSecurityGroupsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeDBSecurityGroupsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof RDS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RDSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected RDS | RDSClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-rds/pagination/DescribeDBSnapshotsPaginator.ts b/clients/client-rds/pagination/DescribeDBSnapshotsPaginator.ts new file mode 100644 index 0000000000000..108175eeb35c0 --- /dev/null +++ b/clients/client-rds/pagination/DescribeDBSnapshotsPaginator.ts @@ -0,0 +1,51 @@ +import { RDS } from "../RDS"; +import { RDSClient } from "../RDSClient"; +import { + DescribeDBSnapshotsCommand, + DescribeDBSnapshotsCommandInput, + DescribeDBSnapshotsCommandOutput, +} from "../commands/DescribeDBSnapshotsCommand"; +import { RDSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RDSClient, + input: DescribeDBSnapshotsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeDBSnapshotsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: RDS, + input: DescribeDBSnapshotsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeDBSnapshots(input, ...args); +}; +export async function* describeDBSnapshotsPaginate( + config: RDSPaginationConfiguration, + input: DescribeDBSnapshotsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeDBSnapshotsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof RDS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RDSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected RDS | RDSClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-rds/pagination/DescribeDBSubnetGroupsPaginator.ts b/clients/client-rds/pagination/DescribeDBSubnetGroupsPaginator.ts new file mode 100644 index 0000000000000..0bdc54ffa7fe1 --- /dev/null +++ b/clients/client-rds/pagination/DescribeDBSubnetGroupsPaginator.ts @@ -0,0 +1,51 @@ +import { RDS } from "../RDS"; +import { RDSClient } from "../RDSClient"; +import { + DescribeDBSubnetGroupsCommand, + DescribeDBSubnetGroupsCommandInput, + DescribeDBSubnetGroupsCommandOutput, +} from "../commands/DescribeDBSubnetGroupsCommand"; +import { RDSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RDSClient, + input: DescribeDBSubnetGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeDBSubnetGroupsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: RDS, + input: DescribeDBSubnetGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeDBSubnetGroups(input, ...args); +}; +export async function* describeDBSubnetGroupsPaginate( + config: RDSPaginationConfiguration, + input: DescribeDBSubnetGroupsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeDBSubnetGroupsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof RDS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RDSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected RDS | RDSClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-rds/pagination/DescribeEventSubscriptionsPaginator.ts b/clients/client-rds/pagination/DescribeEventSubscriptionsPaginator.ts new file mode 100644 index 0000000000000..8e715a8249cd1 --- /dev/null +++ b/clients/client-rds/pagination/DescribeEventSubscriptionsPaginator.ts @@ -0,0 +1,51 @@ +import { RDS } from "../RDS"; +import { RDSClient } from "../RDSClient"; +import { + DescribeEventSubscriptionsCommand, + DescribeEventSubscriptionsCommandInput, + DescribeEventSubscriptionsCommandOutput, +} from "../commands/DescribeEventSubscriptionsCommand"; +import { RDSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RDSClient, + input: DescribeEventSubscriptionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeEventSubscriptionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: RDS, + input: DescribeEventSubscriptionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeEventSubscriptions(input, ...args); +}; +export async function* describeEventSubscriptionsPaginate( + config: RDSPaginationConfiguration, + input: DescribeEventSubscriptionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeEventSubscriptionsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof RDS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RDSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected RDS | RDSClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-rds/pagination/DescribeEventsPaginator.ts b/clients/client-rds/pagination/DescribeEventsPaginator.ts new file mode 100644 index 0000000000000..d1569e23fb684 --- /dev/null +++ b/clients/client-rds/pagination/DescribeEventsPaginator.ts @@ -0,0 +1,51 @@ +import { RDS } from "../RDS"; +import { RDSClient } from "../RDSClient"; +import { + DescribeEventsCommand, + DescribeEventsCommandInput, + DescribeEventsCommandOutput, +} from "../commands/DescribeEventsCommand"; +import { RDSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RDSClient, + input: DescribeEventsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeEventsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: RDS, + input: DescribeEventsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeEvents(input, ...args); +}; +export async function* describeEventsPaginate( + config: RDSPaginationConfiguration, + input: DescribeEventsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeEventsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof RDS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RDSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected RDS | RDSClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-rds/pagination/DescribeExportTasksPaginator.ts b/clients/client-rds/pagination/DescribeExportTasksPaginator.ts new file mode 100644 index 0000000000000..364e70c82c77b --- /dev/null +++ b/clients/client-rds/pagination/DescribeExportTasksPaginator.ts @@ -0,0 +1,51 @@ +import { RDS } from "../RDS"; +import { RDSClient } from "../RDSClient"; +import { + DescribeExportTasksCommand, + DescribeExportTasksCommandInput, + DescribeExportTasksCommandOutput, +} from "../commands/DescribeExportTasksCommand"; +import { RDSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RDSClient, + input: DescribeExportTasksCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeExportTasksCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: RDS, + input: DescribeExportTasksCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeExportTasks(input, ...args); +}; +export async function* describeExportTasksPaginate( + config: RDSPaginationConfiguration, + input: DescribeExportTasksCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeExportTasksCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof RDS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RDSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected RDS | RDSClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-rds/pagination/DescribeGlobalClustersPaginator.ts b/clients/client-rds/pagination/DescribeGlobalClustersPaginator.ts new file mode 100644 index 0000000000000..491b4b7894547 --- /dev/null +++ b/clients/client-rds/pagination/DescribeGlobalClustersPaginator.ts @@ -0,0 +1,51 @@ +import { RDS } from "../RDS"; +import { RDSClient } from "../RDSClient"; +import { + DescribeGlobalClustersCommand, + DescribeGlobalClustersCommandInput, + DescribeGlobalClustersCommandOutput, +} from "../commands/DescribeGlobalClustersCommand"; +import { RDSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RDSClient, + input: DescribeGlobalClustersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeGlobalClustersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: RDS, + input: DescribeGlobalClustersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeGlobalClusters(input, ...args); +}; +export async function* describeGlobalClustersPaginate( + config: RDSPaginationConfiguration, + input: DescribeGlobalClustersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeGlobalClustersCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof RDS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RDSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected RDS | RDSClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-rds/pagination/DescribeInstallationMediaPaginator.ts b/clients/client-rds/pagination/DescribeInstallationMediaPaginator.ts new file mode 100644 index 0000000000000..733750e9e7edc --- /dev/null +++ b/clients/client-rds/pagination/DescribeInstallationMediaPaginator.ts @@ -0,0 +1,51 @@ +import { RDS } from "../RDS"; +import { RDSClient } from "../RDSClient"; +import { + DescribeInstallationMediaCommand, + DescribeInstallationMediaCommandInput, + DescribeInstallationMediaCommandOutput, +} from "../commands/DescribeInstallationMediaCommand"; +import { RDSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RDSClient, + input: DescribeInstallationMediaCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeInstallationMediaCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: RDS, + input: DescribeInstallationMediaCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeInstallationMedia(input, ...args); +}; +export async function* describeInstallationMediaPaginate( + config: RDSPaginationConfiguration, + input: DescribeInstallationMediaCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeInstallationMediaCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof RDS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RDSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected RDS | RDSClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-rds/pagination/DescribeOptionGroupOptionsPaginator.ts b/clients/client-rds/pagination/DescribeOptionGroupOptionsPaginator.ts new file mode 100644 index 0000000000000..8243d9daba3c2 --- /dev/null +++ b/clients/client-rds/pagination/DescribeOptionGroupOptionsPaginator.ts @@ -0,0 +1,51 @@ +import { RDS } from "../RDS"; +import { RDSClient } from "../RDSClient"; +import { + DescribeOptionGroupOptionsCommand, + DescribeOptionGroupOptionsCommandInput, + DescribeOptionGroupOptionsCommandOutput, +} from "../commands/DescribeOptionGroupOptionsCommand"; +import { RDSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RDSClient, + input: DescribeOptionGroupOptionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeOptionGroupOptionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: RDS, + input: DescribeOptionGroupOptionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeOptionGroupOptions(input, ...args); +}; +export async function* describeOptionGroupOptionsPaginate( + config: RDSPaginationConfiguration, + input: DescribeOptionGroupOptionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeOptionGroupOptionsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof RDS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RDSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected RDS | RDSClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-rds/pagination/DescribeOptionGroupsPaginator.ts b/clients/client-rds/pagination/DescribeOptionGroupsPaginator.ts new file mode 100644 index 0000000000000..e3044ff3db844 --- /dev/null +++ b/clients/client-rds/pagination/DescribeOptionGroupsPaginator.ts @@ -0,0 +1,51 @@ +import { RDS } from "../RDS"; +import { RDSClient } from "../RDSClient"; +import { + DescribeOptionGroupsCommand, + DescribeOptionGroupsCommandInput, + DescribeOptionGroupsCommandOutput, +} from "../commands/DescribeOptionGroupsCommand"; +import { RDSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RDSClient, + input: DescribeOptionGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeOptionGroupsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: RDS, + input: DescribeOptionGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeOptionGroups(input, ...args); +}; +export async function* describeOptionGroupsPaginate( + config: RDSPaginationConfiguration, + input: DescribeOptionGroupsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeOptionGroupsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof RDS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RDSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected RDS | RDSClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-rds/pagination/DescribeOrderableDBInstanceOptionsPaginator.ts b/clients/client-rds/pagination/DescribeOrderableDBInstanceOptionsPaginator.ts new file mode 100644 index 0000000000000..06d9e4f57201e --- /dev/null +++ b/clients/client-rds/pagination/DescribeOrderableDBInstanceOptionsPaginator.ts @@ -0,0 +1,51 @@ +import { RDS } from "../RDS"; +import { RDSClient } from "../RDSClient"; +import { + DescribeOrderableDBInstanceOptionsCommand, + DescribeOrderableDBInstanceOptionsCommandInput, + DescribeOrderableDBInstanceOptionsCommandOutput, +} from "../commands/DescribeOrderableDBInstanceOptionsCommand"; +import { RDSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RDSClient, + input: DescribeOrderableDBInstanceOptionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeOrderableDBInstanceOptionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: RDS, + input: DescribeOrderableDBInstanceOptionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeOrderableDBInstanceOptions(input, ...args); +}; +export async function* describeOrderableDBInstanceOptionsPaginate( + config: RDSPaginationConfiguration, + input: DescribeOrderableDBInstanceOptionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeOrderableDBInstanceOptionsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof RDS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RDSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected RDS | RDSClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-rds/pagination/DescribePendingMaintenanceActionsPaginator.ts b/clients/client-rds/pagination/DescribePendingMaintenanceActionsPaginator.ts new file mode 100644 index 0000000000000..0e451d45dfa00 --- /dev/null +++ b/clients/client-rds/pagination/DescribePendingMaintenanceActionsPaginator.ts @@ -0,0 +1,51 @@ +import { RDS } from "../RDS"; +import { RDSClient } from "../RDSClient"; +import { + DescribePendingMaintenanceActionsCommand, + DescribePendingMaintenanceActionsCommandInput, + DescribePendingMaintenanceActionsCommandOutput, +} from "../commands/DescribePendingMaintenanceActionsCommand"; +import { RDSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RDSClient, + input: DescribePendingMaintenanceActionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribePendingMaintenanceActionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: RDS, + input: DescribePendingMaintenanceActionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describePendingMaintenanceActions(input, ...args); +}; +export async function* describePendingMaintenanceActionsPaginate( + config: RDSPaginationConfiguration, + input: DescribePendingMaintenanceActionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribePendingMaintenanceActionsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof RDS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RDSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected RDS | RDSClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-rds/pagination/DescribeReservedDBInstancesOfferingsPaginator.ts b/clients/client-rds/pagination/DescribeReservedDBInstancesOfferingsPaginator.ts new file mode 100644 index 0000000000000..3a9add0d89ddc --- /dev/null +++ b/clients/client-rds/pagination/DescribeReservedDBInstancesOfferingsPaginator.ts @@ -0,0 +1,51 @@ +import { RDS } from "../RDS"; +import { RDSClient } from "../RDSClient"; +import { + DescribeReservedDBInstancesOfferingsCommand, + DescribeReservedDBInstancesOfferingsCommandInput, + DescribeReservedDBInstancesOfferingsCommandOutput, +} from "../commands/DescribeReservedDBInstancesOfferingsCommand"; +import { RDSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RDSClient, + input: DescribeReservedDBInstancesOfferingsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeReservedDBInstancesOfferingsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: RDS, + input: DescribeReservedDBInstancesOfferingsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeReservedDBInstancesOfferings(input, ...args); +}; +export async function* describeReservedDBInstancesOfferingsPaginate( + config: RDSPaginationConfiguration, + input: DescribeReservedDBInstancesOfferingsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeReservedDBInstancesOfferingsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof RDS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RDSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected RDS | RDSClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-rds/pagination/DescribeReservedDBInstancesPaginator.ts b/clients/client-rds/pagination/DescribeReservedDBInstancesPaginator.ts new file mode 100644 index 0000000000000..3574ba09a1b06 --- /dev/null +++ b/clients/client-rds/pagination/DescribeReservedDBInstancesPaginator.ts @@ -0,0 +1,51 @@ +import { RDS } from "../RDS"; +import { RDSClient } from "../RDSClient"; +import { + DescribeReservedDBInstancesCommand, + DescribeReservedDBInstancesCommandInput, + DescribeReservedDBInstancesCommandOutput, +} from "../commands/DescribeReservedDBInstancesCommand"; +import { RDSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RDSClient, + input: DescribeReservedDBInstancesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeReservedDBInstancesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: RDS, + input: DescribeReservedDBInstancesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeReservedDBInstances(input, ...args); +}; +export async function* describeReservedDBInstancesPaginate( + config: RDSPaginationConfiguration, + input: DescribeReservedDBInstancesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeReservedDBInstancesCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof RDS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RDSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected RDS | RDSClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-rds/pagination/DescribeSourceRegionsPaginator.ts b/clients/client-rds/pagination/DescribeSourceRegionsPaginator.ts new file mode 100644 index 0000000000000..8ee57527daae8 --- /dev/null +++ b/clients/client-rds/pagination/DescribeSourceRegionsPaginator.ts @@ -0,0 +1,51 @@ +import { RDS } from "../RDS"; +import { RDSClient } from "../RDSClient"; +import { + DescribeSourceRegionsCommand, + DescribeSourceRegionsCommandInput, + DescribeSourceRegionsCommandOutput, +} from "../commands/DescribeSourceRegionsCommand"; +import { RDSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RDSClient, + input: DescribeSourceRegionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeSourceRegionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: RDS, + input: DescribeSourceRegionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeSourceRegions(input, ...args); +}; +export async function* describeSourceRegionsPaginate( + config: RDSPaginationConfiguration, + input: DescribeSourceRegionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeSourceRegionsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof RDS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RDSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected RDS | RDSClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-rds/pagination/Interfaces.ts b/clients/client-rds/pagination/Interfaces.ts new file mode 100644 index 0000000000000..dcaa0c34cae08 --- /dev/null +++ b/clients/client-rds/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { RDS } from "../RDS"; +import { RDSClient } from "../RDSClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface RDSPaginationConfiguration extends PaginationConfiguration { + client: RDS | RDSClient; +} diff --git a/clients/client-redshift/index.ts b/clients/client-redshift/index.ts index 02b41226ae53f..b818975d0ffeb 100644 --- a/clients/client-redshift/index.ts +++ b/clients/client-redshift/index.ts @@ -36,32 +36,49 @@ export * from "./commands/DeleteUsageLimitCommand"; export * from "./commands/DescribeAccountAttributesCommand"; export * from "./commands/DescribeClusterDbRevisionsCommand"; export * from "./commands/DescribeClusterParameterGroupsCommand"; +export * from "./pagination/DescribeClusterParameterGroupsPaginator"; export * from "./commands/DescribeClusterParametersCommand"; +export * from "./pagination/DescribeClusterParametersPaginator"; export * from "./commands/DescribeClustersCommand"; +export * from "./pagination/DescribeClustersPaginator"; export * from "./commands/DescribeClusterSecurityGroupsCommand"; +export * from "./pagination/DescribeClusterSecurityGroupsPaginator"; export * from "./commands/DescribeClusterSnapshotsCommand"; +export * from "./pagination/DescribeClusterSnapshotsPaginator"; export * from "./commands/DescribeClusterSubnetGroupsCommand"; +export * from "./pagination/DescribeClusterSubnetGroupsPaginator"; export * from "./commands/DescribeClusterTracksCommand"; export * from "./commands/DescribeClusterVersionsCommand"; +export * from "./pagination/DescribeClusterVersionsPaginator"; export * from "./commands/DescribeDefaultClusterParametersCommand"; export * from "./commands/DescribeEventCategoriesCommand"; export * from "./commands/DescribeEventsCommand"; +export * from "./pagination/DescribeEventsPaginator"; export * from "./commands/DescribeEventSubscriptionsCommand"; +export * from "./pagination/DescribeEventSubscriptionsPaginator"; export * from "./commands/DescribeHsmClientCertificatesCommand"; +export * from "./pagination/DescribeHsmClientCertificatesPaginator"; export * from "./commands/DescribeHsmConfigurationsCommand"; +export * from "./pagination/DescribeHsmConfigurationsPaginator"; export * from "./commands/DescribeLoggingStatusCommand"; export * from "./commands/DescribeNodeConfigurationOptionsCommand"; +export * from "./pagination/DescribeNodeConfigurationOptionsPaginator"; export * from "./commands/DescribeOrderableClusterOptionsCommand"; +export * from "./pagination/DescribeOrderableClusterOptionsPaginator"; export * from "./commands/DescribeReservedNodeOfferingsCommand"; +export * from "./pagination/DescribeReservedNodeOfferingsPaginator"; export * from "./commands/DescribeReservedNodesCommand"; +export * from "./pagination/DescribeReservedNodesPaginator"; export * from "./commands/DescribeResizeCommand"; export * from "./commands/DescribeScheduledActionsCommand"; +export * from "./pagination/DescribeScheduledActionsPaginator"; export * from "./commands/DescribeSnapshotCopyGrantsCommand"; export * from "./commands/DescribeSnapshotSchedulesCommand"; export * from "./commands/DescribeStorageCommand"; export * from "./commands/DescribeTableRestoreStatusCommand"; export * from "./commands/DescribeTagsCommand"; export * from "./commands/DescribeUsageLimitsCommand"; +export * from "./pagination/DescribeUsageLimitsPaginator"; export * from "./commands/DisableLoggingCommand"; export * from "./commands/DisableSnapshotCopyCommand"; export * from "./commands/EnableLoggingCommand"; @@ -92,4 +109,5 @@ export * from "./commands/ResumeClusterCommand"; export * from "./commands/RevokeClusterSecurityGroupIngressCommand"; export * from "./commands/RevokeSnapshotAccessCommand"; export * from "./commands/RotateEncryptionKeyCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-redshift/pagination/DescribeClusterParameterGroupsPaginator.ts b/clients/client-redshift/pagination/DescribeClusterParameterGroupsPaginator.ts new file mode 100644 index 0000000000000..e3d54fa069a91 --- /dev/null +++ b/clients/client-redshift/pagination/DescribeClusterParameterGroupsPaginator.ts @@ -0,0 +1,51 @@ +import { Redshift } from "../Redshift"; +import { RedshiftClient } from "../RedshiftClient"; +import { + DescribeClusterParameterGroupsCommand, + DescribeClusterParameterGroupsCommandInput, + DescribeClusterParameterGroupsCommandOutput, +} from "../commands/DescribeClusterParameterGroupsCommand"; +import { RedshiftPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RedshiftClient, + input: DescribeClusterParameterGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeClusterParameterGroupsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Redshift, + input: DescribeClusterParameterGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeClusterParameterGroups(input, ...args); +}; +export async function* describeClusterParameterGroupsPaginate( + config: RedshiftPaginationConfiguration, + input: DescribeClusterParameterGroupsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeClusterParameterGroupsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof Redshift) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RedshiftClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Redshift | RedshiftClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-redshift/pagination/DescribeClusterParametersPaginator.ts b/clients/client-redshift/pagination/DescribeClusterParametersPaginator.ts new file mode 100644 index 0000000000000..36b4e25eb2a16 --- /dev/null +++ b/clients/client-redshift/pagination/DescribeClusterParametersPaginator.ts @@ -0,0 +1,51 @@ +import { Redshift } from "../Redshift"; +import { RedshiftClient } from "../RedshiftClient"; +import { + DescribeClusterParametersCommand, + DescribeClusterParametersCommandInput, + DescribeClusterParametersCommandOutput, +} from "../commands/DescribeClusterParametersCommand"; +import { RedshiftPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RedshiftClient, + input: DescribeClusterParametersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeClusterParametersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Redshift, + input: DescribeClusterParametersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeClusterParameters(input, ...args); +}; +export async function* describeClusterParametersPaginate( + config: RedshiftPaginationConfiguration, + input: DescribeClusterParametersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeClusterParametersCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof Redshift) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RedshiftClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Redshift | RedshiftClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-redshift/pagination/DescribeClusterSecurityGroupsPaginator.ts b/clients/client-redshift/pagination/DescribeClusterSecurityGroupsPaginator.ts new file mode 100644 index 0000000000000..cdc27bb631ea3 --- /dev/null +++ b/clients/client-redshift/pagination/DescribeClusterSecurityGroupsPaginator.ts @@ -0,0 +1,51 @@ +import { Redshift } from "../Redshift"; +import { RedshiftClient } from "../RedshiftClient"; +import { + DescribeClusterSecurityGroupsCommand, + DescribeClusterSecurityGroupsCommandInput, + DescribeClusterSecurityGroupsCommandOutput, +} from "../commands/DescribeClusterSecurityGroupsCommand"; +import { RedshiftPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RedshiftClient, + input: DescribeClusterSecurityGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeClusterSecurityGroupsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Redshift, + input: DescribeClusterSecurityGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeClusterSecurityGroups(input, ...args); +}; +export async function* describeClusterSecurityGroupsPaginate( + config: RedshiftPaginationConfiguration, + input: DescribeClusterSecurityGroupsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeClusterSecurityGroupsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof Redshift) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RedshiftClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Redshift | RedshiftClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-redshift/pagination/DescribeClusterSnapshotsPaginator.ts b/clients/client-redshift/pagination/DescribeClusterSnapshotsPaginator.ts new file mode 100644 index 0000000000000..f81cc1521fd5e --- /dev/null +++ b/clients/client-redshift/pagination/DescribeClusterSnapshotsPaginator.ts @@ -0,0 +1,51 @@ +import { Redshift } from "../Redshift"; +import { RedshiftClient } from "../RedshiftClient"; +import { + DescribeClusterSnapshotsCommand, + DescribeClusterSnapshotsCommandInput, + DescribeClusterSnapshotsCommandOutput, +} from "../commands/DescribeClusterSnapshotsCommand"; +import { RedshiftPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RedshiftClient, + input: DescribeClusterSnapshotsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeClusterSnapshotsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Redshift, + input: DescribeClusterSnapshotsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeClusterSnapshots(input, ...args); +}; +export async function* describeClusterSnapshotsPaginate( + config: RedshiftPaginationConfiguration, + input: DescribeClusterSnapshotsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeClusterSnapshotsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof Redshift) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RedshiftClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Redshift | RedshiftClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-redshift/pagination/DescribeClusterSubnetGroupsPaginator.ts b/clients/client-redshift/pagination/DescribeClusterSubnetGroupsPaginator.ts new file mode 100644 index 0000000000000..22ef16f1e86bf --- /dev/null +++ b/clients/client-redshift/pagination/DescribeClusterSubnetGroupsPaginator.ts @@ -0,0 +1,51 @@ +import { Redshift } from "../Redshift"; +import { RedshiftClient } from "../RedshiftClient"; +import { + DescribeClusterSubnetGroupsCommand, + DescribeClusterSubnetGroupsCommandInput, + DescribeClusterSubnetGroupsCommandOutput, +} from "../commands/DescribeClusterSubnetGroupsCommand"; +import { RedshiftPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RedshiftClient, + input: DescribeClusterSubnetGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeClusterSubnetGroupsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Redshift, + input: DescribeClusterSubnetGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeClusterSubnetGroups(input, ...args); +}; +export async function* describeClusterSubnetGroupsPaginate( + config: RedshiftPaginationConfiguration, + input: DescribeClusterSubnetGroupsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeClusterSubnetGroupsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof Redshift) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RedshiftClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Redshift | RedshiftClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-redshift/pagination/DescribeClusterVersionsPaginator.ts b/clients/client-redshift/pagination/DescribeClusterVersionsPaginator.ts new file mode 100644 index 0000000000000..053081d1aa19c --- /dev/null +++ b/clients/client-redshift/pagination/DescribeClusterVersionsPaginator.ts @@ -0,0 +1,51 @@ +import { Redshift } from "../Redshift"; +import { RedshiftClient } from "../RedshiftClient"; +import { + DescribeClusterVersionsCommand, + DescribeClusterVersionsCommandInput, + DescribeClusterVersionsCommandOutput, +} from "../commands/DescribeClusterVersionsCommand"; +import { RedshiftPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RedshiftClient, + input: DescribeClusterVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeClusterVersionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Redshift, + input: DescribeClusterVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeClusterVersions(input, ...args); +}; +export async function* describeClusterVersionsPaginate( + config: RedshiftPaginationConfiguration, + input: DescribeClusterVersionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeClusterVersionsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof Redshift) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RedshiftClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Redshift | RedshiftClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-redshift/pagination/DescribeClustersPaginator.ts b/clients/client-redshift/pagination/DescribeClustersPaginator.ts new file mode 100644 index 0000000000000..86fb09588f0b9 --- /dev/null +++ b/clients/client-redshift/pagination/DescribeClustersPaginator.ts @@ -0,0 +1,51 @@ +import { Redshift } from "../Redshift"; +import { RedshiftClient } from "../RedshiftClient"; +import { + DescribeClustersCommand, + DescribeClustersCommandInput, + DescribeClustersCommandOutput, +} from "../commands/DescribeClustersCommand"; +import { RedshiftPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RedshiftClient, + input: DescribeClustersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeClustersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Redshift, + input: DescribeClustersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeClusters(input, ...args); +}; +export async function* describeClustersPaginate( + config: RedshiftPaginationConfiguration, + input: DescribeClustersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeClustersCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof Redshift) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RedshiftClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Redshift | RedshiftClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-redshift/pagination/DescribeEventSubscriptionsPaginator.ts b/clients/client-redshift/pagination/DescribeEventSubscriptionsPaginator.ts new file mode 100644 index 0000000000000..da3203d8c054f --- /dev/null +++ b/clients/client-redshift/pagination/DescribeEventSubscriptionsPaginator.ts @@ -0,0 +1,51 @@ +import { Redshift } from "../Redshift"; +import { RedshiftClient } from "../RedshiftClient"; +import { + DescribeEventSubscriptionsCommand, + DescribeEventSubscriptionsCommandInput, + DescribeEventSubscriptionsCommandOutput, +} from "../commands/DescribeEventSubscriptionsCommand"; +import { RedshiftPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RedshiftClient, + input: DescribeEventSubscriptionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeEventSubscriptionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Redshift, + input: DescribeEventSubscriptionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeEventSubscriptions(input, ...args); +}; +export async function* describeEventSubscriptionsPaginate( + config: RedshiftPaginationConfiguration, + input: DescribeEventSubscriptionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeEventSubscriptionsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof Redshift) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RedshiftClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Redshift | RedshiftClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-redshift/pagination/DescribeEventsPaginator.ts b/clients/client-redshift/pagination/DescribeEventsPaginator.ts new file mode 100644 index 0000000000000..a02731b866982 --- /dev/null +++ b/clients/client-redshift/pagination/DescribeEventsPaginator.ts @@ -0,0 +1,51 @@ +import { Redshift } from "../Redshift"; +import { RedshiftClient } from "../RedshiftClient"; +import { + DescribeEventsCommand, + DescribeEventsCommandInput, + DescribeEventsCommandOutput, +} from "../commands/DescribeEventsCommand"; +import { RedshiftPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RedshiftClient, + input: DescribeEventsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeEventsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Redshift, + input: DescribeEventsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeEvents(input, ...args); +}; +export async function* describeEventsPaginate( + config: RedshiftPaginationConfiguration, + input: DescribeEventsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeEventsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof Redshift) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RedshiftClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Redshift | RedshiftClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-redshift/pagination/DescribeHsmClientCertificatesPaginator.ts b/clients/client-redshift/pagination/DescribeHsmClientCertificatesPaginator.ts new file mode 100644 index 0000000000000..a396dcfbc6db4 --- /dev/null +++ b/clients/client-redshift/pagination/DescribeHsmClientCertificatesPaginator.ts @@ -0,0 +1,51 @@ +import { Redshift } from "../Redshift"; +import { RedshiftClient } from "../RedshiftClient"; +import { + DescribeHsmClientCertificatesCommand, + DescribeHsmClientCertificatesCommandInput, + DescribeHsmClientCertificatesCommandOutput, +} from "../commands/DescribeHsmClientCertificatesCommand"; +import { RedshiftPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RedshiftClient, + input: DescribeHsmClientCertificatesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeHsmClientCertificatesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Redshift, + input: DescribeHsmClientCertificatesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeHsmClientCertificates(input, ...args); +}; +export async function* describeHsmClientCertificatesPaginate( + config: RedshiftPaginationConfiguration, + input: DescribeHsmClientCertificatesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeHsmClientCertificatesCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof Redshift) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RedshiftClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Redshift | RedshiftClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-redshift/pagination/DescribeHsmConfigurationsPaginator.ts b/clients/client-redshift/pagination/DescribeHsmConfigurationsPaginator.ts new file mode 100644 index 0000000000000..b117c7ae0eeff --- /dev/null +++ b/clients/client-redshift/pagination/DescribeHsmConfigurationsPaginator.ts @@ -0,0 +1,51 @@ +import { Redshift } from "../Redshift"; +import { RedshiftClient } from "../RedshiftClient"; +import { + DescribeHsmConfigurationsCommand, + DescribeHsmConfigurationsCommandInput, + DescribeHsmConfigurationsCommandOutput, +} from "../commands/DescribeHsmConfigurationsCommand"; +import { RedshiftPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RedshiftClient, + input: DescribeHsmConfigurationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeHsmConfigurationsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Redshift, + input: DescribeHsmConfigurationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeHsmConfigurations(input, ...args); +}; +export async function* describeHsmConfigurationsPaginate( + config: RedshiftPaginationConfiguration, + input: DescribeHsmConfigurationsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeHsmConfigurationsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof Redshift) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RedshiftClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Redshift | RedshiftClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-redshift/pagination/DescribeNodeConfigurationOptionsPaginator.ts b/clients/client-redshift/pagination/DescribeNodeConfigurationOptionsPaginator.ts new file mode 100644 index 0000000000000..b8ee56335ec77 --- /dev/null +++ b/clients/client-redshift/pagination/DescribeNodeConfigurationOptionsPaginator.ts @@ -0,0 +1,51 @@ +import { Redshift } from "../Redshift"; +import { RedshiftClient } from "../RedshiftClient"; +import { + DescribeNodeConfigurationOptionsCommand, + DescribeNodeConfigurationOptionsCommandInput, + DescribeNodeConfigurationOptionsCommandOutput, +} from "../commands/DescribeNodeConfigurationOptionsCommand"; +import { RedshiftPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RedshiftClient, + input: DescribeNodeConfigurationOptionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeNodeConfigurationOptionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Redshift, + input: DescribeNodeConfigurationOptionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeNodeConfigurationOptions(input, ...args); +}; +export async function* describeNodeConfigurationOptionsPaginate( + config: RedshiftPaginationConfiguration, + input: DescribeNodeConfigurationOptionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeNodeConfigurationOptionsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof Redshift) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RedshiftClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Redshift | RedshiftClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-redshift/pagination/DescribeOrderableClusterOptionsPaginator.ts b/clients/client-redshift/pagination/DescribeOrderableClusterOptionsPaginator.ts new file mode 100644 index 0000000000000..40285b1c51a51 --- /dev/null +++ b/clients/client-redshift/pagination/DescribeOrderableClusterOptionsPaginator.ts @@ -0,0 +1,51 @@ +import { Redshift } from "../Redshift"; +import { RedshiftClient } from "../RedshiftClient"; +import { + DescribeOrderableClusterOptionsCommand, + DescribeOrderableClusterOptionsCommandInput, + DescribeOrderableClusterOptionsCommandOutput, +} from "../commands/DescribeOrderableClusterOptionsCommand"; +import { RedshiftPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RedshiftClient, + input: DescribeOrderableClusterOptionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeOrderableClusterOptionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Redshift, + input: DescribeOrderableClusterOptionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeOrderableClusterOptions(input, ...args); +}; +export async function* describeOrderableClusterOptionsPaginate( + config: RedshiftPaginationConfiguration, + input: DescribeOrderableClusterOptionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeOrderableClusterOptionsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof Redshift) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RedshiftClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Redshift | RedshiftClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-redshift/pagination/DescribeReservedNodeOfferingsPaginator.ts b/clients/client-redshift/pagination/DescribeReservedNodeOfferingsPaginator.ts new file mode 100644 index 0000000000000..d3ac56992ec12 --- /dev/null +++ b/clients/client-redshift/pagination/DescribeReservedNodeOfferingsPaginator.ts @@ -0,0 +1,51 @@ +import { Redshift } from "../Redshift"; +import { RedshiftClient } from "../RedshiftClient"; +import { + DescribeReservedNodeOfferingsCommand, + DescribeReservedNodeOfferingsCommandInput, + DescribeReservedNodeOfferingsCommandOutput, +} from "../commands/DescribeReservedNodeOfferingsCommand"; +import { RedshiftPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RedshiftClient, + input: DescribeReservedNodeOfferingsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeReservedNodeOfferingsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Redshift, + input: DescribeReservedNodeOfferingsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeReservedNodeOfferings(input, ...args); +}; +export async function* describeReservedNodeOfferingsPaginate( + config: RedshiftPaginationConfiguration, + input: DescribeReservedNodeOfferingsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeReservedNodeOfferingsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof Redshift) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RedshiftClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Redshift | RedshiftClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-redshift/pagination/DescribeReservedNodesPaginator.ts b/clients/client-redshift/pagination/DescribeReservedNodesPaginator.ts new file mode 100644 index 0000000000000..323b6f7e47186 --- /dev/null +++ b/clients/client-redshift/pagination/DescribeReservedNodesPaginator.ts @@ -0,0 +1,51 @@ +import { Redshift } from "../Redshift"; +import { RedshiftClient } from "../RedshiftClient"; +import { + DescribeReservedNodesCommand, + DescribeReservedNodesCommandInput, + DescribeReservedNodesCommandOutput, +} from "../commands/DescribeReservedNodesCommand"; +import { RedshiftPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RedshiftClient, + input: DescribeReservedNodesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeReservedNodesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Redshift, + input: DescribeReservedNodesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeReservedNodes(input, ...args); +}; +export async function* describeReservedNodesPaginate( + config: RedshiftPaginationConfiguration, + input: DescribeReservedNodesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeReservedNodesCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof Redshift) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RedshiftClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Redshift | RedshiftClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-redshift/pagination/DescribeScheduledActionsPaginator.ts b/clients/client-redshift/pagination/DescribeScheduledActionsPaginator.ts new file mode 100644 index 0000000000000..409461cb1dc15 --- /dev/null +++ b/clients/client-redshift/pagination/DescribeScheduledActionsPaginator.ts @@ -0,0 +1,51 @@ +import { Redshift } from "../Redshift"; +import { RedshiftClient } from "../RedshiftClient"; +import { + DescribeScheduledActionsCommand, + DescribeScheduledActionsCommandInput, + DescribeScheduledActionsCommandOutput, +} from "../commands/DescribeScheduledActionsCommand"; +import { RedshiftPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RedshiftClient, + input: DescribeScheduledActionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeScheduledActionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Redshift, + input: DescribeScheduledActionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeScheduledActions(input, ...args); +}; +export async function* describeScheduledActionsPaginate( + config: RedshiftPaginationConfiguration, + input: DescribeScheduledActionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeScheduledActionsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof Redshift) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RedshiftClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Redshift | RedshiftClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-redshift/pagination/DescribeUsageLimitsPaginator.ts b/clients/client-redshift/pagination/DescribeUsageLimitsPaginator.ts new file mode 100644 index 0000000000000..c4e869ed30eec --- /dev/null +++ b/clients/client-redshift/pagination/DescribeUsageLimitsPaginator.ts @@ -0,0 +1,51 @@ +import { Redshift } from "../Redshift"; +import { RedshiftClient } from "../RedshiftClient"; +import { + DescribeUsageLimitsCommand, + DescribeUsageLimitsCommandInput, + DescribeUsageLimitsCommandOutput, +} from "../commands/DescribeUsageLimitsCommand"; +import { RedshiftPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RedshiftClient, + input: DescribeUsageLimitsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeUsageLimitsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Redshift, + input: DescribeUsageLimitsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeUsageLimits(input, ...args); +}; +export async function* describeUsageLimitsPaginate( + config: RedshiftPaginationConfiguration, + input: DescribeUsageLimitsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeUsageLimitsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxRecords"] = config.pageSize; + if (config.client instanceof Redshift) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RedshiftClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Redshift | RedshiftClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-redshift/pagination/Interfaces.ts b/clients/client-redshift/pagination/Interfaces.ts new file mode 100644 index 0000000000000..2e117b98b3792 --- /dev/null +++ b/clients/client-redshift/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { Redshift } from "../Redshift"; +import { RedshiftClient } from "../RedshiftClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface RedshiftPaginationConfiguration extends PaginationConfiguration { + client: Redshift | RedshiftClient; +} diff --git a/clients/client-rekognition/index.ts b/clients/client-rekognition/index.ts index dc4f4408f2553..77661f05f2377 100644 --- a/clients/client-rekognition/index.ts +++ b/clients/client-rekognition/index.ts @@ -12,7 +12,9 @@ export * from "./commands/DeleteProjectVersionCommand"; export * from "./commands/DeleteStreamProcessorCommand"; export * from "./commands/DescribeCollectionCommand"; export * from "./commands/DescribeProjectsCommand"; +export * from "./pagination/DescribeProjectsPaginator"; export * from "./commands/DescribeProjectVersionsCommand"; +export * from "./pagination/DescribeProjectVersionsPaginator"; export * from "./commands/DescribeStreamProcessorCommand"; export * from "./commands/DetectCustomLabelsCommand"; export * from "./commands/DetectFacesCommand"; @@ -21,17 +23,28 @@ export * from "./commands/DetectModerationLabelsCommand"; export * from "./commands/DetectTextCommand"; export * from "./commands/GetCelebrityInfoCommand"; export * from "./commands/GetCelebrityRecognitionCommand"; +export * from "./pagination/GetCelebrityRecognitionPaginator"; export * from "./commands/GetContentModerationCommand"; +export * from "./pagination/GetContentModerationPaginator"; export * from "./commands/GetFaceDetectionCommand"; +export * from "./pagination/GetFaceDetectionPaginator"; export * from "./commands/GetFaceSearchCommand"; +export * from "./pagination/GetFaceSearchPaginator"; export * from "./commands/GetLabelDetectionCommand"; +export * from "./pagination/GetLabelDetectionPaginator"; export * from "./commands/GetPersonTrackingCommand"; +export * from "./pagination/GetPersonTrackingPaginator"; export * from "./commands/GetSegmentDetectionCommand"; +export * from "./pagination/GetSegmentDetectionPaginator"; export * from "./commands/GetTextDetectionCommand"; +export * from "./pagination/GetTextDetectionPaginator"; export * from "./commands/IndexFacesCommand"; export * from "./commands/ListCollectionsCommand"; +export * from "./pagination/ListCollectionsPaginator"; export * from "./commands/ListFacesCommand"; +export * from "./pagination/ListFacesPaginator"; export * from "./commands/ListStreamProcessorsCommand"; +export * from "./pagination/ListStreamProcessorsPaginator"; export * from "./commands/RecognizeCelebritiesCommand"; export * from "./commands/SearchFacesCommand"; export * from "./commands/SearchFacesByImageCommand"; @@ -47,4 +60,5 @@ export * from "./commands/StartStreamProcessorCommand"; export * from "./commands/StartTextDetectionCommand"; export * from "./commands/StopProjectVersionCommand"; export * from "./commands/StopStreamProcessorCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-rekognition/pagination/DescribeProjectVersionsPaginator.ts b/clients/client-rekognition/pagination/DescribeProjectVersionsPaginator.ts new file mode 100644 index 0000000000000..1156c1cd1ae40 --- /dev/null +++ b/clients/client-rekognition/pagination/DescribeProjectVersionsPaginator.ts @@ -0,0 +1,51 @@ +import { Rekognition } from "../Rekognition"; +import { RekognitionClient } from "../RekognitionClient"; +import { + DescribeProjectVersionsCommand, + DescribeProjectVersionsCommandInput, + DescribeProjectVersionsCommandOutput, +} from "../commands/DescribeProjectVersionsCommand"; +import { RekognitionPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RekognitionClient, + input: DescribeProjectVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeProjectVersionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Rekognition, + input: DescribeProjectVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeProjectVersions(input, ...args); +}; +export async function* describeProjectVersionsPaginate( + config: RekognitionPaginationConfiguration, + input: DescribeProjectVersionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeProjectVersionsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Rekognition) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RekognitionClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Rekognition | RekognitionClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-rekognition/pagination/DescribeProjectsPaginator.ts b/clients/client-rekognition/pagination/DescribeProjectsPaginator.ts new file mode 100644 index 0000000000000..eed16a7abf09f --- /dev/null +++ b/clients/client-rekognition/pagination/DescribeProjectsPaginator.ts @@ -0,0 +1,51 @@ +import { Rekognition } from "../Rekognition"; +import { RekognitionClient } from "../RekognitionClient"; +import { + DescribeProjectsCommand, + DescribeProjectsCommandInput, + DescribeProjectsCommandOutput, +} from "../commands/DescribeProjectsCommand"; +import { RekognitionPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RekognitionClient, + input: DescribeProjectsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeProjectsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Rekognition, + input: DescribeProjectsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeProjects(input, ...args); +}; +export async function* describeProjectsPaginate( + config: RekognitionPaginationConfiguration, + input: DescribeProjectsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeProjectsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Rekognition) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RekognitionClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Rekognition | RekognitionClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-rekognition/pagination/GetCelebrityRecognitionPaginator.ts b/clients/client-rekognition/pagination/GetCelebrityRecognitionPaginator.ts new file mode 100644 index 0000000000000..f0af769dfea81 --- /dev/null +++ b/clients/client-rekognition/pagination/GetCelebrityRecognitionPaginator.ts @@ -0,0 +1,51 @@ +import { Rekognition } from "../Rekognition"; +import { RekognitionClient } from "../RekognitionClient"; +import { + GetCelebrityRecognitionCommand, + GetCelebrityRecognitionCommandInput, + GetCelebrityRecognitionCommandOutput, +} from "../commands/GetCelebrityRecognitionCommand"; +import { RekognitionPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RekognitionClient, + input: GetCelebrityRecognitionCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetCelebrityRecognitionCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Rekognition, + input: GetCelebrityRecognitionCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getCelebrityRecognition(input, ...args); +}; +export async function* getCelebrityRecognitionPaginate( + config: RekognitionPaginationConfiguration, + input: GetCelebrityRecognitionCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetCelebrityRecognitionCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Rekognition) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RekognitionClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Rekognition | RekognitionClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-rekognition/pagination/GetContentModerationPaginator.ts b/clients/client-rekognition/pagination/GetContentModerationPaginator.ts new file mode 100644 index 0000000000000..8e5ac76722eb4 --- /dev/null +++ b/clients/client-rekognition/pagination/GetContentModerationPaginator.ts @@ -0,0 +1,51 @@ +import { Rekognition } from "../Rekognition"; +import { RekognitionClient } from "../RekognitionClient"; +import { + GetContentModerationCommand, + GetContentModerationCommandInput, + GetContentModerationCommandOutput, +} from "../commands/GetContentModerationCommand"; +import { RekognitionPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RekognitionClient, + input: GetContentModerationCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetContentModerationCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Rekognition, + input: GetContentModerationCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getContentModeration(input, ...args); +}; +export async function* getContentModerationPaginate( + config: RekognitionPaginationConfiguration, + input: GetContentModerationCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetContentModerationCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Rekognition) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RekognitionClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Rekognition | RekognitionClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-rekognition/pagination/GetFaceDetectionPaginator.ts b/clients/client-rekognition/pagination/GetFaceDetectionPaginator.ts new file mode 100644 index 0000000000000..b55c3e9ea1c5d --- /dev/null +++ b/clients/client-rekognition/pagination/GetFaceDetectionPaginator.ts @@ -0,0 +1,51 @@ +import { Rekognition } from "../Rekognition"; +import { RekognitionClient } from "../RekognitionClient"; +import { + GetFaceDetectionCommand, + GetFaceDetectionCommandInput, + GetFaceDetectionCommandOutput, +} from "../commands/GetFaceDetectionCommand"; +import { RekognitionPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RekognitionClient, + input: GetFaceDetectionCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetFaceDetectionCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Rekognition, + input: GetFaceDetectionCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getFaceDetection(input, ...args); +}; +export async function* getFaceDetectionPaginate( + config: RekognitionPaginationConfiguration, + input: GetFaceDetectionCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetFaceDetectionCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Rekognition) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RekognitionClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Rekognition | RekognitionClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-rekognition/pagination/GetFaceSearchPaginator.ts b/clients/client-rekognition/pagination/GetFaceSearchPaginator.ts new file mode 100644 index 0000000000000..f1b7f7c241c98 --- /dev/null +++ b/clients/client-rekognition/pagination/GetFaceSearchPaginator.ts @@ -0,0 +1,51 @@ +import { Rekognition } from "../Rekognition"; +import { RekognitionClient } from "../RekognitionClient"; +import { + GetFaceSearchCommand, + GetFaceSearchCommandInput, + GetFaceSearchCommandOutput, +} from "../commands/GetFaceSearchCommand"; +import { RekognitionPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RekognitionClient, + input: GetFaceSearchCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetFaceSearchCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Rekognition, + input: GetFaceSearchCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getFaceSearch(input, ...args); +}; +export async function* getFaceSearchPaginate( + config: RekognitionPaginationConfiguration, + input: GetFaceSearchCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetFaceSearchCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Rekognition) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RekognitionClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Rekognition | RekognitionClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-rekognition/pagination/GetLabelDetectionPaginator.ts b/clients/client-rekognition/pagination/GetLabelDetectionPaginator.ts new file mode 100644 index 0000000000000..6ddf8612e9092 --- /dev/null +++ b/clients/client-rekognition/pagination/GetLabelDetectionPaginator.ts @@ -0,0 +1,51 @@ +import { Rekognition } from "../Rekognition"; +import { RekognitionClient } from "../RekognitionClient"; +import { + GetLabelDetectionCommand, + GetLabelDetectionCommandInput, + GetLabelDetectionCommandOutput, +} from "../commands/GetLabelDetectionCommand"; +import { RekognitionPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RekognitionClient, + input: GetLabelDetectionCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetLabelDetectionCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Rekognition, + input: GetLabelDetectionCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getLabelDetection(input, ...args); +}; +export async function* getLabelDetectionPaginate( + config: RekognitionPaginationConfiguration, + input: GetLabelDetectionCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetLabelDetectionCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Rekognition) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RekognitionClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Rekognition | RekognitionClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-rekognition/pagination/GetPersonTrackingPaginator.ts b/clients/client-rekognition/pagination/GetPersonTrackingPaginator.ts new file mode 100644 index 0000000000000..9cf7852537232 --- /dev/null +++ b/clients/client-rekognition/pagination/GetPersonTrackingPaginator.ts @@ -0,0 +1,51 @@ +import { Rekognition } from "../Rekognition"; +import { RekognitionClient } from "../RekognitionClient"; +import { + GetPersonTrackingCommand, + GetPersonTrackingCommandInput, + GetPersonTrackingCommandOutput, +} from "../commands/GetPersonTrackingCommand"; +import { RekognitionPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RekognitionClient, + input: GetPersonTrackingCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetPersonTrackingCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Rekognition, + input: GetPersonTrackingCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getPersonTracking(input, ...args); +}; +export async function* getPersonTrackingPaginate( + config: RekognitionPaginationConfiguration, + input: GetPersonTrackingCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetPersonTrackingCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Rekognition) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RekognitionClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Rekognition | RekognitionClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-rekognition/pagination/GetSegmentDetectionPaginator.ts b/clients/client-rekognition/pagination/GetSegmentDetectionPaginator.ts new file mode 100644 index 0000000000000..80e93842c245f --- /dev/null +++ b/clients/client-rekognition/pagination/GetSegmentDetectionPaginator.ts @@ -0,0 +1,51 @@ +import { Rekognition } from "../Rekognition"; +import { RekognitionClient } from "../RekognitionClient"; +import { + GetSegmentDetectionCommand, + GetSegmentDetectionCommandInput, + GetSegmentDetectionCommandOutput, +} from "../commands/GetSegmentDetectionCommand"; +import { RekognitionPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RekognitionClient, + input: GetSegmentDetectionCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetSegmentDetectionCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Rekognition, + input: GetSegmentDetectionCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getSegmentDetection(input, ...args); +}; +export async function* getSegmentDetectionPaginate( + config: RekognitionPaginationConfiguration, + input: GetSegmentDetectionCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetSegmentDetectionCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Rekognition) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RekognitionClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Rekognition | RekognitionClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-rekognition/pagination/GetTextDetectionPaginator.ts b/clients/client-rekognition/pagination/GetTextDetectionPaginator.ts new file mode 100644 index 0000000000000..53bf992016d1f --- /dev/null +++ b/clients/client-rekognition/pagination/GetTextDetectionPaginator.ts @@ -0,0 +1,51 @@ +import { Rekognition } from "../Rekognition"; +import { RekognitionClient } from "../RekognitionClient"; +import { + GetTextDetectionCommand, + GetTextDetectionCommandInput, + GetTextDetectionCommandOutput, +} from "../commands/GetTextDetectionCommand"; +import { RekognitionPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RekognitionClient, + input: GetTextDetectionCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetTextDetectionCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Rekognition, + input: GetTextDetectionCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getTextDetection(input, ...args); +}; +export async function* getTextDetectionPaginate( + config: RekognitionPaginationConfiguration, + input: GetTextDetectionCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetTextDetectionCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Rekognition) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RekognitionClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Rekognition | RekognitionClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-rekognition/pagination/Interfaces.ts b/clients/client-rekognition/pagination/Interfaces.ts new file mode 100644 index 0000000000000..c7cd0b98054e8 --- /dev/null +++ b/clients/client-rekognition/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { Rekognition } from "../Rekognition"; +import { RekognitionClient } from "../RekognitionClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface RekognitionPaginationConfiguration extends PaginationConfiguration { + client: Rekognition | RekognitionClient; +} diff --git a/clients/client-rekognition/pagination/ListCollectionsPaginator.ts b/clients/client-rekognition/pagination/ListCollectionsPaginator.ts new file mode 100644 index 0000000000000..b92fe0e33be07 --- /dev/null +++ b/clients/client-rekognition/pagination/ListCollectionsPaginator.ts @@ -0,0 +1,51 @@ +import { Rekognition } from "../Rekognition"; +import { RekognitionClient } from "../RekognitionClient"; +import { + ListCollectionsCommand, + ListCollectionsCommandInput, + ListCollectionsCommandOutput, +} from "../commands/ListCollectionsCommand"; +import { RekognitionPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RekognitionClient, + input: ListCollectionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListCollectionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Rekognition, + input: ListCollectionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listCollections(input, ...args); +}; +export async function* listCollectionsPaginate( + config: RekognitionPaginationConfiguration, + input: ListCollectionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListCollectionsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Rekognition) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RekognitionClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Rekognition | RekognitionClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-rekognition/pagination/ListFacesPaginator.ts b/clients/client-rekognition/pagination/ListFacesPaginator.ts new file mode 100644 index 0000000000000..c949ddaa08fbc --- /dev/null +++ b/clients/client-rekognition/pagination/ListFacesPaginator.ts @@ -0,0 +1,47 @@ +import { Rekognition } from "../Rekognition"; +import { RekognitionClient } from "../RekognitionClient"; +import { ListFacesCommand, ListFacesCommandInput, ListFacesCommandOutput } from "../commands/ListFacesCommand"; +import { RekognitionPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RekognitionClient, + input: ListFacesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListFacesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Rekognition, + input: ListFacesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listFaces(input, ...args); +}; +export async function* listFacesPaginate( + config: RekognitionPaginationConfiguration, + input: ListFacesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListFacesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Rekognition) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RekognitionClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Rekognition | RekognitionClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-rekognition/pagination/ListStreamProcessorsPaginator.ts b/clients/client-rekognition/pagination/ListStreamProcessorsPaginator.ts new file mode 100644 index 0000000000000..ea479963f39a4 --- /dev/null +++ b/clients/client-rekognition/pagination/ListStreamProcessorsPaginator.ts @@ -0,0 +1,51 @@ +import { Rekognition } from "../Rekognition"; +import { RekognitionClient } from "../RekognitionClient"; +import { + ListStreamProcessorsCommand, + ListStreamProcessorsCommandInput, + ListStreamProcessorsCommandOutput, +} from "../commands/ListStreamProcessorsCommand"; +import { RekognitionPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RekognitionClient, + input: ListStreamProcessorsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListStreamProcessorsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Rekognition, + input: ListStreamProcessorsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listStreamProcessors(input, ...args); +}; +export async function* listStreamProcessorsPaginate( + config: RekognitionPaginationConfiguration, + input: ListStreamProcessorsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListStreamProcessorsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Rekognition) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RekognitionClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Rekognition | RekognitionClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-resource-groups-tagging-api/index.ts b/clients/client-resource-groups-tagging-api/index.ts index 928728da7d8ce..9eca91db7a359 100644 --- a/clients/client-resource-groups-tagging-api/index.ts +++ b/clients/client-resource-groups-tagging-api/index.ts @@ -2,10 +2,15 @@ export * from "./ResourceGroupsTaggingAPIClient"; export * from "./ResourceGroupsTaggingAPI"; export * from "./commands/DescribeReportCreationCommand"; export * from "./commands/GetComplianceSummaryCommand"; +export * from "./pagination/GetComplianceSummaryPaginator"; export * from "./commands/GetResourcesCommand"; +export * from "./pagination/GetResourcesPaginator"; export * from "./commands/GetTagKeysCommand"; +export * from "./pagination/GetTagKeysPaginator"; export * from "./commands/GetTagValuesCommand"; +export * from "./pagination/GetTagValuesPaginator"; export * from "./commands/StartReportCreationCommand"; export * from "./commands/TagResourcesCommand"; export * from "./commands/UntagResourcesCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-resource-groups-tagging-api/pagination/GetComplianceSummaryPaginator.ts b/clients/client-resource-groups-tagging-api/pagination/GetComplianceSummaryPaginator.ts new file mode 100644 index 0000000000000..a6d0026163e0d --- /dev/null +++ b/clients/client-resource-groups-tagging-api/pagination/GetComplianceSummaryPaginator.ts @@ -0,0 +1,51 @@ +import { ResourceGroupsTaggingAPI } from "../ResourceGroupsTaggingAPI"; +import { ResourceGroupsTaggingAPIClient } from "../ResourceGroupsTaggingAPIClient"; +import { + GetComplianceSummaryCommand, + GetComplianceSummaryCommandInput, + GetComplianceSummaryCommandOutput, +} from "../commands/GetComplianceSummaryCommand"; +import { ResourceGroupsTaggingAPIPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ResourceGroupsTaggingAPIClient, + input: GetComplianceSummaryCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetComplianceSummaryCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ResourceGroupsTaggingAPI, + input: GetComplianceSummaryCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getComplianceSummary(input, ...args); +}; +export async function* getComplianceSummaryPaginate( + config: ResourceGroupsTaggingAPIPaginationConfiguration, + input: GetComplianceSummaryCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetComplianceSummaryCommandOutput; + while (hasNext) { + input["PaginationToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof ResourceGroupsTaggingAPI) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ResourceGroupsTaggingAPIClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ResourceGroupsTaggingAPI | ResourceGroupsTaggingAPIClient"); + } + yield page; + token = page["PaginationToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-resource-groups-tagging-api/pagination/GetResourcesPaginator.ts b/clients/client-resource-groups-tagging-api/pagination/GetResourcesPaginator.ts new file mode 100644 index 0000000000000..3576f756a3ae6 --- /dev/null +++ b/clients/client-resource-groups-tagging-api/pagination/GetResourcesPaginator.ts @@ -0,0 +1,51 @@ +import { ResourceGroupsTaggingAPI } from "../ResourceGroupsTaggingAPI"; +import { ResourceGroupsTaggingAPIClient } from "../ResourceGroupsTaggingAPIClient"; +import { + GetResourcesCommand, + GetResourcesCommandInput, + GetResourcesCommandOutput, +} from "../commands/GetResourcesCommand"; +import { ResourceGroupsTaggingAPIPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ResourceGroupsTaggingAPIClient, + input: GetResourcesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetResourcesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ResourceGroupsTaggingAPI, + input: GetResourcesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getResources(input, ...args); +}; +export async function* getResourcesPaginate( + config: ResourceGroupsTaggingAPIPaginationConfiguration, + input: GetResourcesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetResourcesCommandOutput; + while (hasNext) { + input["PaginationToken"] = token; + input["ResourcesPerPage"] = config.pageSize; + if (config.client instanceof ResourceGroupsTaggingAPI) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ResourceGroupsTaggingAPIClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ResourceGroupsTaggingAPI | ResourceGroupsTaggingAPIClient"); + } + yield page; + token = page["PaginationToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-resource-groups-tagging-api/pagination/GetTagKeysPaginator.ts b/clients/client-resource-groups-tagging-api/pagination/GetTagKeysPaginator.ts new file mode 100644 index 0000000000000..1be61bd58e0c7 --- /dev/null +++ b/clients/client-resource-groups-tagging-api/pagination/GetTagKeysPaginator.ts @@ -0,0 +1,46 @@ +import { ResourceGroupsTaggingAPI } from "../ResourceGroupsTaggingAPI"; +import { ResourceGroupsTaggingAPIClient } from "../ResourceGroupsTaggingAPIClient"; +import { GetTagKeysCommand, GetTagKeysCommandInput, GetTagKeysCommandOutput } from "../commands/GetTagKeysCommand"; +import { ResourceGroupsTaggingAPIPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ResourceGroupsTaggingAPIClient, + input: GetTagKeysCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetTagKeysCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ResourceGroupsTaggingAPI, + input: GetTagKeysCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getTagKeys(input, ...args); +}; +export async function* getTagKeysPaginate( + config: ResourceGroupsTaggingAPIPaginationConfiguration, + input: GetTagKeysCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetTagKeysCommandOutput; + while (hasNext) { + input["PaginationToken"] = token; + if (config.client instanceof ResourceGroupsTaggingAPI) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ResourceGroupsTaggingAPIClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ResourceGroupsTaggingAPI | ResourceGroupsTaggingAPIClient"); + } + yield page; + token = page["PaginationToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-resource-groups-tagging-api/pagination/GetTagValuesPaginator.ts b/clients/client-resource-groups-tagging-api/pagination/GetTagValuesPaginator.ts new file mode 100644 index 0000000000000..e78d2588aeee9 --- /dev/null +++ b/clients/client-resource-groups-tagging-api/pagination/GetTagValuesPaginator.ts @@ -0,0 +1,50 @@ +import { ResourceGroupsTaggingAPI } from "../ResourceGroupsTaggingAPI"; +import { ResourceGroupsTaggingAPIClient } from "../ResourceGroupsTaggingAPIClient"; +import { + GetTagValuesCommand, + GetTagValuesCommandInput, + GetTagValuesCommandOutput, +} from "../commands/GetTagValuesCommand"; +import { ResourceGroupsTaggingAPIPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ResourceGroupsTaggingAPIClient, + input: GetTagValuesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetTagValuesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ResourceGroupsTaggingAPI, + input: GetTagValuesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getTagValues(input, ...args); +}; +export async function* getTagValuesPaginate( + config: ResourceGroupsTaggingAPIPaginationConfiguration, + input: GetTagValuesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetTagValuesCommandOutput; + while (hasNext) { + input["PaginationToken"] = token; + if (config.client instanceof ResourceGroupsTaggingAPI) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ResourceGroupsTaggingAPIClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ResourceGroupsTaggingAPI | ResourceGroupsTaggingAPIClient"); + } + yield page; + token = page["PaginationToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-resource-groups-tagging-api/pagination/Interfaces.ts b/clients/client-resource-groups-tagging-api/pagination/Interfaces.ts new file mode 100644 index 0000000000000..1945dc69c8324 --- /dev/null +++ b/clients/client-resource-groups-tagging-api/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { ResourceGroupsTaggingAPI } from "../ResourceGroupsTaggingAPI"; +import { ResourceGroupsTaggingAPIClient } from "../ResourceGroupsTaggingAPIClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface ResourceGroupsTaggingAPIPaginationConfiguration extends PaginationConfiguration { + client: ResourceGroupsTaggingAPI | ResourceGroupsTaggingAPIClient; +} diff --git a/clients/client-resource-groups/index.ts b/clients/client-resource-groups/index.ts index 8d3ce75a32c86..2279a14aa3f55 100644 --- a/clients/client-resource-groups/index.ts +++ b/clients/client-resource-groups/index.ts @@ -8,11 +8,15 @@ export * from "./commands/GetGroupQueryCommand"; export * from "./commands/GetTagsCommand"; export * from "./commands/GroupResourcesCommand"; export * from "./commands/ListGroupResourcesCommand"; +export * from "./pagination/ListGroupResourcesPaginator"; export * from "./commands/ListGroupsCommand"; +export * from "./pagination/ListGroupsPaginator"; export * from "./commands/SearchResourcesCommand"; +export * from "./pagination/SearchResourcesPaginator"; export * from "./commands/TagCommand"; export * from "./commands/UngroupResourcesCommand"; export * from "./commands/UntagCommand"; export * from "./commands/UpdateGroupCommand"; export * from "./commands/UpdateGroupQueryCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-resource-groups/pagination/Interfaces.ts b/clients/client-resource-groups/pagination/Interfaces.ts new file mode 100644 index 0000000000000..e7e6b3a9a6c85 --- /dev/null +++ b/clients/client-resource-groups/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { ResourceGroups } from "../ResourceGroups"; +import { ResourceGroupsClient } from "../ResourceGroupsClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface ResourceGroupsPaginationConfiguration extends PaginationConfiguration { + client: ResourceGroups | ResourceGroupsClient; +} diff --git a/clients/client-resource-groups/pagination/ListGroupResourcesPaginator.ts b/clients/client-resource-groups/pagination/ListGroupResourcesPaginator.ts new file mode 100644 index 0000000000000..33615ff25065c --- /dev/null +++ b/clients/client-resource-groups/pagination/ListGroupResourcesPaginator.ts @@ -0,0 +1,51 @@ +import { ResourceGroups } from "../ResourceGroups"; +import { ResourceGroupsClient } from "../ResourceGroupsClient"; +import { + ListGroupResourcesCommand, + ListGroupResourcesCommandInput, + ListGroupResourcesCommandOutput, +} from "../commands/ListGroupResourcesCommand"; +import { ResourceGroupsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ResourceGroupsClient, + input: ListGroupResourcesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListGroupResourcesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ResourceGroups, + input: ListGroupResourcesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listGroupResources(input, ...args); +}; +export async function* listGroupResourcesPaginate( + config: ResourceGroupsPaginationConfiguration, + input: ListGroupResourcesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListGroupResourcesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof ResourceGroups) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ResourceGroupsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ResourceGroups | ResourceGroupsClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-resource-groups/pagination/ListGroupsPaginator.ts b/clients/client-resource-groups/pagination/ListGroupsPaginator.ts new file mode 100644 index 0000000000000..9b83afbe7ef4b --- /dev/null +++ b/clients/client-resource-groups/pagination/ListGroupsPaginator.ts @@ -0,0 +1,47 @@ +import { ResourceGroups } from "../ResourceGroups"; +import { ResourceGroupsClient } from "../ResourceGroupsClient"; +import { ListGroupsCommand, ListGroupsCommandInput, ListGroupsCommandOutput } from "../commands/ListGroupsCommand"; +import { ResourceGroupsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ResourceGroupsClient, + input: ListGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListGroupsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ResourceGroups, + input: ListGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listGroups(input, ...args); +}; +export async function* listGroupsPaginate( + config: ResourceGroupsPaginationConfiguration, + input: ListGroupsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListGroupsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof ResourceGroups) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ResourceGroupsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ResourceGroups | ResourceGroupsClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-resource-groups/pagination/SearchResourcesPaginator.ts b/clients/client-resource-groups/pagination/SearchResourcesPaginator.ts new file mode 100644 index 0000000000000..7323129f87c59 --- /dev/null +++ b/clients/client-resource-groups/pagination/SearchResourcesPaginator.ts @@ -0,0 +1,51 @@ +import { ResourceGroups } from "../ResourceGroups"; +import { ResourceGroupsClient } from "../ResourceGroupsClient"; +import { + SearchResourcesCommand, + SearchResourcesCommandInput, + SearchResourcesCommandOutput, +} from "../commands/SearchResourcesCommand"; +import { ResourceGroupsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ResourceGroupsClient, + input: SearchResourcesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new SearchResourcesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ResourceGroups, + input: SearchResourcesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.searchResources(input, ...args); +}; +export async function* searchResourcesPaginate( + config: ResourceGroupsPaginationConfiguration, + input: SearchResourcesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: SearchResourcesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof ResourceGroups) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ResourceGroupsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ResourceGroups | ResourceGroupsClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-robomaker/index.ts b/clients/client-robomaker/index.ts index 4ea2afe028449..67e621d62dcae 100644 --- a/clients/client-robomaker/index.ts +++ b/clients/client-robomaker/index.ts @@ -25,12 +25,19 @@ export * from "./commands/DescribeSimulationApplicationCommand"; export * from "./commands/DescribeSimulationJobCommand"; export * from "./commands/DescribeSimulationJobBatchCommand"; export * from "./commands/ListDeploymentJobsCommand"; +export * from "./pagination/ListDeploymentJobsPaginator"; export * from "./commands/ListFleetsCommand"; +export * from "./pagination/ListFleetsPaginator"; export * from "./commands/ListRobotApplicationsCommand"; +export * from "./pagination/ListRobotApplicationsPaginator"; export * from "./commands/ListRobotsCommand"; +export * from "./pagination/ListRobotsPaginator"; export * from "./commands/ListSimulationApplicationsCommand"; +export * from "./pagination/ListSimulationApplicationsPaginator"; export * from "./commands/ListSimulationJobBatchesCommand"; +export * from "./pagination/ListSimulationJobBatchesPaginator"; export * from "./commands/ListSimulationJobsCommand"; +export * from "./pagination/ListSimulationJobsPaginator"; export * from "./commands/ListTagsForResourceCommand"; export * from "./commands/RegisterRobotCommand"; export * from "./commands/RestartSimulationJobCommand"; @@ -40,4 +47,5 @@ export * from "./commands/TagResourceCommand"; export * from "./commands/UntagResourceCommand"; export * from "./commands/UpdateRobotApplicationCommand"; export * from "./commands/UpdateSimulationApplicationCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-robomaker/pagination/Interfaces.ts b/clients/client-robomaker/pagination/Interfaces.ts new file mode 100644 index 0000000000000..ebaab5387299f --- /dev/null +++ b/clients/client-robomaker/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { RoboMaker } from "../RoboMaker"; +import { RoboMakerClient } from "../RoboMakerClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface RoboMakerPaginationConfiguration extends PaginationConfiguration { + client: RoboMaker | RoboMakerClient; +} diff --git a/clients/client-robomaker/pagination/ListDeploymentJobsPaginator.ts b/clients/client-robomaker/pagination/ListDeploymentJobsPaginator.ts new file mode 100644 index 0000000000000..84e14da85e1e1 --- /dev/null +++ b/clients/client-robomaker/pagination/ListDeploymentJobsPaginator.ts @@ -0,0 +1,51 @@ +import { RoboMaker } from "../RoboMaker"; +import { RoboMakerClient } from "../RoboMakerClient"; +import { + ListDeploymentJobsCommand, + ListDeploymentJobsCommandInput, + ListDeploymentJobsCommandOutput, +} from "../commands/ListDeploymentJobsCommand"; +import { RoboMakerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RoboMakerClient, + input: ListDeploymentJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDeploymentJobsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: RoboMaker, + input: ListDeploymentJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDeploymentJobs(input, ...args); +}; +export async function* listDeploymentJobsPaginate( + config: RoboMakerPaginationConfiguration, + input: ListDeploymentJobsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDeploymentJobsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof RoboMaker) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RoboMakerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected RoboMaker | RoboMakerClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-robomaker/pagination/ListFleetsPaginator.ts b/clients/client-robomaker/pagination/ListFleetsPaginator.ts new file mode 100644 index 0000000000000..068c4242b4685 --- /dev/null +++ b/clients/client-robomaker/pagination/ListFleetsPaginator.ts @@ -0,0 +1,47 @@ +import { RoboMaker } from "../RoboMaker"; +import { RoboMakerClient } from "../RoboMakerClient"; +import { ListFleetsCommand, ListFleetsCommandInput, ListFleetsCommandOutput } from "../commands/ListFleetsCommand"; +import { RoboMakerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RoboMakerClient, + input: ListFleetsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListFleetsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: RoboMaker, + input: ListFleetsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listFleets(input, ...args); +}; +export async function* listFleetsPaginate( + config: RoboMakerPaginationConfiguration, + input: ListFleetsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListFleetsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof RoboMaker) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RoboMakerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected RoboMaker | RoboMakerClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-robomaker/pagination/ListRobotApplicationsPaginator.ts b/clients/client-robomaker/pagination/ListRobotApplicationsPaginator.ts new file mode 100644 index 0000000000000..a534ed8d09c81 --- /dev/null +++ b/clients/client-robomaker/pagination/ListRobotApplicationsPaginator.ts @@ -0,0 +1,51 @@ +import { RoboMaker } from "../RoboMaker"; +import { RoboMakerClient } from "../RoboMakerClient"; +import { + ListRobotApplicationsCommand, + ListRobotApplicationsCommandInput, + ListRobotApplicationsCommandOutput, +} from "../commands/ListRobotApplicationsCommand"; +import { RoboMakerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RoboMakerClient, + input: ListRobotApplicationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListRobotApplicationsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: RoboMaker, + input: ListRobotApplicationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listRobotApplications(input, ...args); +}; +export async function* listRobotApplicationsPaginate( + config: RoboMakerPaginationConfiguration, + input: ListRobotApplicationsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListRobotApplicationsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof RoboMaker) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RoboMakerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected RoboMaker | RoboMakerClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-robomaker/pagination/ListRobotsPaginator.ts b/clients/client-robomaker/pagination/ListRobotsPaginator.ts new file mode 100644 index 0000000000000..2b03c560d8a22 --- /dev/null +++ b/clients/client-robomaker/pagination/ListRobotsPaginator.ts @@ -0,0 +1,47 @@ +import { RoboMaker } from "../RoboMaker"; +import { RoboMakerClient } from "../RoboMakerClient"; +import { ListRobotsCommand, ListRobotsCommandInput, ListRobotsCommandOutput } from "../commands/ListRobotsCommand"; +import { RoboMakerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RoboMakerClient, + input: ListRobotsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListRobotsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: RoboMaker, + input: ListRobotsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listRobots(input, ...args); +}; +export async function* listRobotsPaginate( + config: RoboMakerPaginationConfiguration, + input: ListRobotsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListRobotsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof RoboMaker) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RoboMakerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected RoboMaker | RoboMakerClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-robomaker/pagination/ListSimulationApplicationsPaginator.ts b/clients/client-robomaker/pagination/ListSimulationApplicationsPaginator.ts new file mode 100644 index 0000000000000..c69ffcf36cdd0 --- /dev/null +++ b/clients/client-robomaker/pagination/ListSimulationApplicationsPaginator.ts @@ -0,0 +1,51 @@ +import { RoboMaker } from "../RoboMaker"; +import { RoboMakerClient } from "../RoboMakerClient"; +import { + ListSimulationApplicationsCommand, + ListSimulationApplicationsCommandInput, + ListSimulationApplicationsCommandOutput, +} from "../commands/ListSimulationApplicationsCommand"; +import { RoboMakerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RoboMakerClient, + input: ListSimulationApplicationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListSimulationApplicationsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: RoboMaker, + input: ListSimulationApplicationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listSimulationApplications(input, ...args); +}; +export async function* listSimulationApplicationsPaginate( + config: RoboMakerPaginationConfiguration, + input: ListSimulationApplicationsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListSimulationApplicationsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof RoboMaker) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RoboMakerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected RoboMaker | RoboMakerClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-robomaker/pagination/ListSimulationJobBatchesPaginator.ts b/clients/client-robomaker/pagination/ListSimulationJobBatchesPaginator.ts new file mode 100644 index 0000000000000..610692398c424 --- /dev/null +++ b/clients/client-robomaker/pagination/ListSimulationJobBatchesPaginator.ts @@ -0,0 +1,51 @@ +import { RoboMaker } from "../RoboMaker"; +import { RoboMakerClient } from "../RoboMakerClient"; +import { + ListSimulationJobBatchesCommand, + ListSimulationJobBatchesCommandInput, + ListSimulationJobBatchesCommandOutput, +} from "../commands/ListSimulationJobBatchesCommand"; +import { RoboMakerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RoboMakerClient, + input: ListSimulationJobBatchesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListSimulationJobBatchesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: RoboMaker, + input: ListSimulationJobBatchesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listSimulationJobBatches(input, ...args); +}; +export async function* listSimulationJobBatchesPaginate( + config: RoboMakerPaginationConfiguration, + input: ListSimulationJobBatchesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListSimulationJobBatchesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof RoboMaker) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RoboMakerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected RoboMaker | RoboMakerClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-robomaker/pagination/ListSimulationJobsPaginator.ts b/clients/client-robomaker/pagination/ListSimulationJobsPaginator.ts new file mode 100644 index 0000000000000..be04e4dca6717 --- /dev/null +++ b/clients/client-robomaker/pagination/ListSimulationJobsPaginator.ts @@ -0,0 +1,51 @@ +import { RoboMaker } from "../RoboMaker"; +import { RoboMakerClient } from "../RoboMakerClient"; +import { + ListSimulationJobsCommand, + ListSimulationJobsCommandInput, + ListSimulationJobsCommandOutput, +} from "../commands/ListSimulationJobsCommand"; +import { RoboMakerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: RoboMakerClient, + input: ListSimulationJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListSimulationJobsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: RoboMaker, + input: ListSimulationJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listSimulationJobs(input, ...args); +}; +export async function* listSimulationJobsPaginate( + config: RoboMakerPaginationConfiguration, + input: ListSimulationJobsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListSimulationJobsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof RoboMaker) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof RoboMakerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected RoboMaker | RoboMakerClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-route-53-domains/index.ts b/clients/client-route-53-domains/index.ts index 1c833fd88cad9..ab5c15ee7f5b9 100644 --- a/clients/client-route-53-domains/index.ts +++ b/clients/client-route-53-domains/index.ts @@ -14,7 +14,9 @@ export * from "./commands/GetDomainDetailCommand"; export * from "./commands/GetDomainSuggestionsCommand"; export * from "./commands/GetOperationDetailCommand"; export * from "./commands/ListDomainsCommand"; +export * from "./pagination/ListDomainsPaginator"; export * from "./commands/ListOperationsCommand"; +export * from "./pagination/ListOperationsPaginator"; export * from "./commands/ListTagsForDomainCommand"; export * from "./commands/RegisterDomainCommand"; export * from "./commands/RejectDomainTransferFromAnotherAwsAccountCommand"; @@ -28,4 +30,5 @@ export * from "./commands/UpdateDomainContactPrivacyCommand"; export * from "./commands/UpdateDomainNameserversCommand"; export * from "./commands/UpdateTagsForDomainCommand"; export * from "./commands/ViewBillingCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-route-53-domains/pagination/Interfaces.ts b/clients/client-route-53-domains/pagination/Interfaces.ts new file mode 100644 index 0000000000000..139ef265ec61b --- /dev/null +++ b/clients/client-route-53-domains/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { Route53Domains } from "../Route53Domains"; +import { Route53DomainsClient } from "../Route53DomainsClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface Route53DomainsPaginationConfiguration extends PaginationConfiguration { + client: Route53Domains | Route53DomainsClient; +} diff --git a/clients/client-route-53-domains/pagination/ListDomainsPaginator.ts b/clients/client-route-53-domains/pagination/ListDomainsPaginator.ts new file mode 100644 index 0000000000000..054df668ef5b7 --- /dev/null +++ b/clients/client-route-53-domains/pagination/ListDomainsPaginator.ts @@ -0,0 +1,47 @@ +import { Route53Domains } from "../Route53Domains"; +import { Route53DomainsClient } from "../Route53DomainsClient"; +import { ListDomainsCommand, ListDomainsCommandInput, ListDomainsCommandOutput } from "../commands/ListDomainsCommand"; +import { Route53DomainsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: Route53DomainsClient, + input: ListDomainsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDomainsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Route53Domains, + input: ListDomainsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDomains(input, ...args); +}; +export async function* listDomainsPaginate( + config: Route53DomainsPaginationConfiguration, + input: ListDomainsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDomainsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxItems"] = config.pageSize; + if (config.client instanceof Route53Domains) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof Route53DomainsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Route53Domains | Route53DomainsClient"); + } + yield page; + token = page["NextPageMarker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-route-53-domains/pagination/ListOperationsPaginator.ts b/clients/client-route-53-domains/pagination/ListOperationsPaginator.ts new file mode 100644 index 0000000000000..9f2db442be0c3 --- /dev/null +++ b/clients/client-route-53-domains/pagination/ListOperationsPaginator.ts @@ -0,0 +1,51 @@ +import { Route53Domains } from "../Route53Domains"; +import { Route53DomainsClient } from "../Route53DomainsClient"; +import { + ListOperationsCommand, + ListOperationsCommandInput, + ListOperationsCommandOutput, +} from "../commands/ListOperationsCommand"; +import { Route53DomainsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: Route53DomainsClient, + input: ListOperationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListOperationsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Route53Domains, + input: ListOperationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listOperations(input, ...args); +}; +export async function* listOperationsPaginate( + config: Route53DomainsPaginationConfiguration, + input: ListOperationsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListOperationsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["MaxItems"] = config.pageSize; + if (config.client instanceof Route53Domains) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof Route53DomainsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Route53Domains | Route53DomainsClient"); + } + yield page; + token = page["NextPageMarker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-route53resolver/index.ts b/clients/client-route53resolver/index.ts index 45b0d6dfc8630..58c9c560cb52c 100644 --- a/clients/client-route53resolver/index.ts +++ b/clients/client-route53resolver/index.ts @@ -13,13 +13,18 @@ export * from "./commands/GetResolverRuleCommand"; export * from "./commands/GetResolverRuleAssociationCommand"; export * from "./commands/GetResolverRulePolicyCommand"; export * from "./commands/ListResolverEndpointIpAddressesCommand"; +export * from "./pagination/ListResolverEndpointIpAddressesPaginator"; export * from "./commands/ListResolverEndpointsCommand"; +export * from "./pagination/ListResolverEndpointsPaginator"; export * from "./commands/ListResolverRuleAssociationsCommand"; +export * from "./pagination/ListResolverRuleAssociationsPaginator"; export * from "./commands/ListResolverRulesCommand"; +export * from "./pagination/ListResolverRulesPaginator"; export * from "./commands/ListTagsForResourceCommand"; export * from "./commands/PutResolverRulePolicyCommand"; export * from "./commands/TagResourceCommand"; export * from "./commands/UntagResourceCommand"; export * from "./commands/UpdateResolverEndpointCommand"; export * from "./commands/UpdateResolverRuleCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-route53resolver/pagination/Interfaces.ts b/clients/client-route53resolver/pagination/Interfaces.ts new file mode 100644 index 0000000000000..367a8023b4aa0 --- /dev/null +++ b/clients/client-route53resolver/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { Route53Resolver } from "../Route53Resolver"; +import { Route53ResolverClient } from "../Route53ResolverClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface Route53ResolverPaginationConfiguration extends PaginationConfiguration { + client: Route53Resolver | Route53ResolverClient; +} diff --git a/clients/client-route53resolver/pagination/ListResolverEndpointIpAddressesPaginator.ts b/clients/client-route53resolver/pagination/ListResolverEndpointIpAddressesPaginator.ts new file mode 100644 index 0000000000000..3f8cf3120a34f --- /dev/null +++ b/clients/client-route53resolver/pagination/ListResolverEndpointIpAddressesPaginator.ts @@ -0,0 +1,51 @@ +import { Route53Resolver } from "../Route53Resolver"; +import { Route53ResolverClient } from "../Route53ResolverClient"; +import { + ListResolverEndpointIpAddressesCommand, + ListResolverEndpointIpAddressesCommandInput, + ListResolverEndpointIpAddressesCommandOutput, +} from "../commands/ListResolverEndpointIpAddressesCommand"; +import { Route53ResolverPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: Route53ResolverClient, + input: ListResolverEndpointIpAddressesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListResolverEndpointIpAddressesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Route53Resolver, + input: ListResolverEndpointIpAddressesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listResolverEndpointIpAddresses(input, ...args); +}; +export async function* listResolverEndpointIpAddressesPaginate( + config: Route53ResolverPaginationConfiguration, + input: ListResolverEndpointIpAddressesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListResolverEndpointIpAddressesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Route53Resolver) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof Route53ResolverClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Route53Resolver | Route53ResolverClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-route53resolver/pagination/ListResolverEndpointsPaginator.ts b/clients/client-route53resolver/pagination/ListResolverEndpointsPaginator.ts new file mode 100644 index 0000000000000..90a1977b12e6e --- /dev/null +++ b/clients/client-route53resolver/pagination/ListResolverEndpointsPaginator.ts @@ -0,0 +1,51 @@ +import { Route53Resolver } from "../Route53Resolver"; +import { Route53ResolverClient } from "../Route53ResolverClient"; +import { + ListResolverEndpointsCommand, + ListResolverEndpointsCommandInput, + ListResolverEndpointsCommandOutput, +} from "../commands/ListResolverEndpointsCommand"; +import { Route53ResolverPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: Route53ResolverClient, + input: ListResolverEndpointsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListResolverEndpointsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Route53Resolver, + input: ListResolverEndpointsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listResolverEndpoints(input, ...args); +}; +export async function* listResolverEndpointsPaginate( + config: Route53ResolverPaginationConfiguration, + input: ListResolverEndpointsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListResolverEndpointsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Route53Resolver) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof Route53ResolverClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Route53Resolver | Route53ResolverClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-route53resolver/pagination/ListResolverRuleAssociationsPaginator.ts b/clients/client-route53resolver/pagination/ListResolverRuleAssociationsPaginator.ts new file mode 100644 index 0000000000000..b293095caf9a4 --- /dev/null +++ b/clients/client-route53resolver/pagination/ListResolverRuleAssociationsPaginator.ts @@ -0,0 +1,51 @@ +import { Route53Resolver } from "../Route53Resolver"; +import { Route53ResolverClient } from "../Route53ResolverClient"; +import { + ListResolverRuleAssociationsCommand, + ListResolverRuleAssociationsCommandInput, + ListResolverRuleAssociationsCommandOutput, +} from "../commands/ListResolverRuleAssociationsCommand"; +import { Route53ResolverPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: Route53ResolverClient, + input: ListResolverRuleAssociationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListResolverRuleAssociationsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Route53Resolver, + input: ListResolverRuleAssociationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listResolverRuleAssociations(input, ...args); +}; +export async function* listResolverRuleAssociationsPaginate( + config: Route53ResolverPaginationConfiguration, + input: ListResolverRuleAssociationsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListResolverRuleAssociationsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Route53Resolver) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof Route53ResolverClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Route53Resolver | Route53ResolverClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-route53resolver/pagination/ListResolverRulesPaginator.ts b/clients/client-route53resolver/pagination/ListResolverRulesPaginator.ts new file mode 100644 index 0000000000000..44ffe019dfebf --- /dev/null +++ b/clients/client-route53resolver/pagination/ListResolverRulesPaginator.ts @@ -0,0 +1,51 @@ +import { Route53Resolver } from "../Route53Resolver"; +import { Route53ResolverClient } from "../Route53ResolverClient"; +import { + ListResolverRulesCommand, + ListResolverRulesCommandInput, + ListResolverRulesCommandOutput, +} from "../commands/ListResolverRulesCommand"; +import { Route53ResolverPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: Route53ResolverClient, + input: ListResolverRulesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListResolverRulesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Route53Resolver, + input: ListResolverRulesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listResolverRules(input, ...args); +}; +export async function* listResolverRulesPaginate( + config: Route53ResolverPaginationConfiguration, + input: ListResolverRulesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListResolverRulesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Route53Resolver) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof Route53ResolverClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Route53Resolver | Route53ResolverClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-s3-control/index.ts b/clients/client-s3-control/index.ts index e2524b1fca628..ad975d35ce38e 100644 --- a/clients/client-s3-control/index.ts +++ b/clients/client-s3-control/index.ts @@ -13,10 +13,13 @@ export * from "./commands/GetAccessPointPolicyStatusCommand"; export * from "./commands/GetJobTaggingCommand"; export * from "./commands/GetPublicAccessBlockCommand"; export * from "./commands/ListAccessPointsCommand"; +export * from "./pagination/ListAccessPointsPaginator"; export * from "./commands/ListJobsCommand"; +export * from "./pagination/ListJobsPaginator"; export * from "./commands/PutAccessPointPolicyCommand"; export * from "./commands/PutJobTaggingCommand"; export * from "./commands/PutPublicAccessBlockCommand"; export * from "./commands/UpdateJobPriorityCommand"; export * from "./commands/UpdateJobStatusCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-s3-control/pagination/Interfaces.ts b/clients/client-s3-control/pagination/Interfaces.ts new file mode 100644 index 0000000000000..f583ccd588955 --- /dev/null +++ b/clients/client-s3-control/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { S3Control } from "../S3Control"; +import { S3ControlClient } from "../S3ControlClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface S3ControlPaginationConfiguration extends PaginationConfiguration { + client: S3Control | S3ControlClient; +} diff --git a/clients/client-s3-control/pagination/ListAccessPointsPaginator.ts b/clients/client-s3-control/pagination/ListAccessPointsPaginator.ts new file mode 100644 index 0000000000000..5a080e5f67bde --- /dev/null +++ b/clients/client-s3-control/pagination/ListAccessPointsPaginator.ts @@ -0,0 +1,51 @@ +import { S3Control } from "../S3Control"; +import { S3ControlClient } from "../S3ControlClient"; +import { + ListAccessPointsCommand, + ListAccessPointsCommandInput, + ListAccessPointsCommandOutput, +} from "../commands/ListAccessPointsCommand"; +import { S3ControlPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: S3ControlClient, + input: ListAccessPointsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListAccessPointsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: S3Control, + input: ListAccessPointsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listAccessPoints(input, ...args); +}; +export async function* listAccessPointsPaginate( + config: S3ControlPaginationConfiguration, + input: ListAccessPointsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListAccessPointsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof S3Control) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof S3ControlClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected S3Control | S3ControlClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-s3-control/pagination/ListJobsPaginator.ts b/clients/client-s3-control/pagination/ListJobsPaginator.ts new file mode 100644 index 0000000000000..da7a80e5fdfdb --- /dev/null +++ b/clients/client-s3-control/pagination/ListJobsPaginator.ts @@ -0,0 +1,47 @@ +import { S3Control } from "../S3Control"; +import { S3ControlClient } from "../S3ControlClient"; +import { ListJobsCommand, ListJobsCommandInput, ListJobsCommandOutput } from "../commands/ListJobsCommand"; +import { S3ControlPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: S3ControlClient, + input: ListJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListJobsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: S3Control, + input: ListJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listJobs(input, ...args); +}; +export async function* listJobsPaginate( + config: S3ControlPaginationConfiguration, + input: ListJobsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListJobsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof S3Control) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof S3ControlClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected S3Control | S3ControlClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-s3/index.ts b/clients/client-s3/index.ts index db50a7ebb6596..702794fad8d10 100644 --- a/clients/client-s3/index.ts +++ b/clients/client-s3/index.ts @@ -55,6 +55,7 @@ export * from "./commands/ListBucketsCommand"; export * from "./commands/ListMultipartUploadsCommand"; export * from "./commands/ListObjectsCommand"; export * from "./commands/ListObjectsV2Command"; +export * from "./pagination/ListObjectsV2Paginator"; export * from "./commands/ListObjectVersionsCommand"; export * from "./commands/ListPartsCommand"; export * from "./commands/PutBucketAccelerateConfigurationCommand"; @@ -84,4 +85,5 @@ export * from "./commands/RestoreObjectCommand"; export * from "./commands/SelectObjectContentCommand"; export * from "./commands/UploadPartCommand"; export * from "./commands/UploadPartCopyCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-s3/pagination/Interfaces.ts b/clients/client-s3/pagination/Interfaces.ts new file mode 100644 index 0000000000000..486ce185632f8 --- /dev/null +++ b/clients/client-s3/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { S3 } from "../S3"; +import { S3Client } from "../S3Client"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface S3PaginationConfiguration extends PaginationConfiguration { + client: S3 | S3Client; +} diff --git a/clients/client-s3/pagination/ListObjectsV2Paginator.ts b/clients/client-s3/pagination/ListObjectsV2Paginator.ts new file mode 100644 index 0000000000000..9dcbf9a4e45c6 --- /dev/null +++ b/clients/client-s3/pagination/ListObjectsV2Paginator.ts @@ -0,0 +1,51 @@ +import { S3 } from "../S3"; +import { S3Client } from "../S3Client"; +import { + ListObjectsV2Command, + ListObjectsV2CommandInput, + ListObjectsV2CommandOutput, +} from "../commands/ListObjectsV2Command"; +import { S3PaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: S3Client, + input: ListObjectsV2CommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListObjectsV2Command(input, ...args)); +}; +const makePagedRequest = async ( + client: S3, + input: ListObjectsV2CommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listObjectsV2(input, ...args); +}; +export async function* listObjectsV2Paginate( + config: S3PaginationConfiguration, + input: ListObjectsV2CommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListObjectsV2CommandOutput; + while (hasNext) { + input["ContinuationToken"] = token; + input["MaxKeys"] = config.pageSize; + if (config.client instanceof S3) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof S3Client) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected S3 | S3Client"); + } + yield page; + token = page["NextContinuationToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sagemaker-a2i-runtime/index.ts b/clients/client-sagemaker-a2i-runtime/index.ts index 8653e92c8bc8a..53741664fd99c 100644 --- a/clients/client-sagemaker-a2i-runtime/index.ts +++ b/clients/client-sagemaker-a2i-runtime/index.ts @@ -3,6 +3,8 @@ export * from "./SageMakerA2IRuntime"; export * from "./commands/DeleteHumanLoopCommand"; export * from "./commands/DescribeHumanLoopCommand"; export * from "./commands/ListHumanLoopsCommand"; +export * from "./pagination/ListHumanLoopsPaginator"; export * from "./commands/StartHumanLoopCommand"; export * from "./commands/StopHumanLoopCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-sagemaker-a2i-runtime/pagination/Interfaces.ts b/clients/client-sagemaker-a2i-runtime/pagination/Interfaces.ts new file mode 100644 index 0000000000000..d9a12d17d1022 --- /dev/null +++ b/clients/client-sagemaker-a2i-runtime/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { SageMakerA2IRuntime } from "../SageMakerA2IRuntime"; +import { SageMakerA2IRuntimeClient } from "../SageMakerA2IRuntimeClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface SageMakerA2IRuntimePaginationConfiguration extends PaginationConfiguration { + client: SageMakerA2IRuntime | SageMakerA2IRuntimeClient; +} diff --git a/clients/client-sagemaker-a2i-runtime/pagination/ListHumanLoopsPaginator.ts b/clients/client-sagemaker-a2i-runtime/pagination/ListHumanLoopsPaginator.ts new file mode 100644 index 0000000000000..3434c4a73ca01 --- /dev/null +++ b/clients/client-sagemaker-a2i-runtime/pagination/ListHumanLoopsPaginator.ts @@ -0,0 +1,51 @@ +import { SageMakerA2IRuntime } from "../SageMakerA2IRuntime"; +import { SageMakerA2IRuntimeClient } from "../SageMakerA2IRuntimeClient"; +import { + ListHumanLoopsCommand, + ListHumanLoopsCommandInput, + ListHumanLoopsCommandOutput, +} from "../commands/ListHumanLoopsCommand"; +import { SageMakerA2IRuntimePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SageMakerA2IRuntimeClient, + input: ListHumanLoopsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListHumanLoopsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SageMakerA2IRuntime, + input: ListHumanLoopsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listHumanLoops(input, ...args); +}; +export async function* listHumanLoopsPaginate( + config: SageMakerA2IRuntimePaginationConfiguration, + input: ListHumanLoopsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListHumanLoopsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SageMakerA2IRuntime) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SageMakerA2IRuntimeClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SageMakerA2IRuntime | SageMakerA2IRuntimeClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sagemaker/index.ts b/clients/client-sagemaker/index.ts index 812257cf416c1..f63e54d2da91f 100644 --- a/clients/client-sagemaker/index.ts +++ b/clients/client-sagemaker/index.ts @@ -80,39 +80,72 @@ export * from "./commands/DescribeWorkteamCommand"; export * from "./commands/DisassociateTrialComponentCommand"; export * from "./commands/GetSearchSuggestionsCommand"; export * from "./commands/ListAlgorithmsCommand"; +export * from "./pagination/ListAlgorithmsPaginator"; export * from "./commands/ListAppsCommand"; +export * from "./pagination/ListAppsPaginator"; export * from "./commands/ListAutoMLJobsCommand"; +export * from "./pagination/ListAutoMLJobsPaginator"; export * from "./commands/ListCandidatesForAutoMLJobCommand"; +export * from "./pagination/ListCandidatesForAutoMLJobPaginator"; export * from "./commands/ListCodeRepositoriesCommand"; +export * from "./pagination/ListCodeRepositoriesPaginator"; export * from "./commands/ListCompilationJobsCommand"; +export * from "./pagination/ListCompilationJobsPaginator"; export * from "./commands/ListDomainsCommand"; +export * from "./pagination/ListDomainsPaginator"; export * from "./commands/ListEndpointConfigsCommand"; +export * from "./pagination/ListEndpointConfigsPaginator"; export * from "./commands/ListEndpointsCommand"; +export * from "./pagination/ListEndpointsPaginator"; export * from "./commands/ListExperimentsCommand"; +export * from "./pagination/ListExperimentsPaginator"; export * from "./commands/ListFlowDefinitionsCommand"; +export * from "./pagination/ListFlowDefinitionsPaginator"; export * from "./commands/ListHumanTaskUisCommand"; +export * from "./pagination/ListHumanTaskUisPaginator"; export * from "./commands/ListHyperParameterTuningJobsCommand"; +export * from "./pagination/ListHyperParameterTuningJobsPaginator"; export * from "./commands/ListLabelingJobsCommand"; +export * from "./pagination/ListLabelingJobsPaginator"; export * from "./commands/ListLabelingJobsForWorkteamCommand"; +export * from "./pagination/ListLabelingJobsForWorkteamPaginator"; export * from "./commands/ListModelPackagesCommand"; +export * from "./pagination/ListModelPackagesPaginator"; export * from "./commands/ListModelsCommand"; +export * from "./pagination/ListModelsPaginator"; export * from "./commands/ListMonitoringExecutionsCommand"; +export * from "./pagination/ListMonitoringExecutionsPaginator"; export * from "./commands/ListMonitoringSchedulesCommand"; +export * from "./pagination/ListMonitoringSchedulesPaginator"; export * from "./commands/ListNotebookInstanceLifecycleConfigsCommand"; +export * from "./pagination/ListNotebookInstanceLifecycleConfigsPaginator"; export * from "./commands/ListNotebookInstancesCommand"; +export * from "./pagination/ListNotebookInstancesPaginator"; export * from "./commands/ListProcessingJobsCommand"; +export * from "./pagination/ListProcessingJobsPaginator"; export * from "./commands/ListSubscribedWorkteamsCommand"; +export * from "./pagination/ListSubscribedWorkteamsPaginator"; export * from "./commands/ListTagsCommand"; +export * from "./pagination/ListTagsPaginator"; export * from "./commands/ListTrainingJobsCommand"; +export * from "./pagination/ListTrainingJobsPaginator"; export * from "./commands/ListTrainingJobsForHyperParameterTuningJobCommand"; +export * from "./pagination/ListTrainingJobsForHyperParameterTuningJobPaginator"; export * from "./commands/ListTransformJobsCommand"; +export * from "./pagination/ListTransformJobsPaginator"; export * from "./commands/ListTrialComponentsCommand"; +export * from "./pagination/ListTrialComponentsPaginator"; export * from "./commands/ListTrialsCommand"; +export * from "./pagination/ListTrialsPaginator"; export * from "./commands/ListUserProfilesCommand"; +export * from "./pagination/ListUserProfilesPaginator"; export * from "./commands/ListWorkforcesCommand"; +export * from "./pagination/ListWorkforcesPaginator"; export * from "./commands/ListWorkteamsCommand"; +export * from "./pagination/ListWorkteamsPaginator"; export * from "./commands/RenderUiTemplateCommand"; export * from "./commands/SearchCommand"; +export * from "./pagination/SearchPaginator"; export * from "./commands/StartMonitoringScheduleCommand"; export * from "./commands/StartNotebookInstanceCommand"; export * from "./commands/StopAutoMLJobCommand"; @@ -137,4 +170,5 @@ export * from "./commands/UpdateTrialComponentCommand"; export * from "./commands/UpdateUserProfileCommand"; export * from "./commands/UpdateWorkforceCommand"; export * from "./commands/UpdateWorkteamCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-sagemaker/pagination/Interfaces.ts b/clients/client-sagemaker/pagination/Interfaces.ts new file mode 100644 index 0000000000000..d634793cf2460 --- /dev/null +++ b/clients/client-sagemaker/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { SageMaker } from "../SageMaker"; +import { SageMakerClient } from "../SageMakerClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface SageMakerPaginationConfiguration extends PaginationConfiguration { + client: SageMaker | SageMakerClient; +} diff --git a/clients/client-sagemaker/pagination/ListAlgorithmsPaginator.ts b/clients/client-sagemaker/pagination/ListAlgorithmsPaginator.ts new file mode 100644 index 0000000000000..35eb951757e8d --- /dev/null +++ b/clients/client-sagemaker/pagination/ListAlgorithmsPaginator.ts @@ -0,0 +1,51 @@ +import { SageMaker } from "../SageMaker"; +import { SageMakerClient } from "../SageMakerClient"; +import { + ListAlgorithmsCommand, + ListAlgorithmsCommandInput, + ListAlgorithmsCommandOutput, +} from "../commands/ListAlgorithmsCommand"; +import { SageMakerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SageMakerClient, + input: ListAlgorithmsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListAlgorithmsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SageMaker, + input: ListAlgorithmsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listAlgorithms(input, ...args); +}; +export async function* listAlgorithmsPaginate( + config: SageMakerPaginationConfiguration, + input: ListAlgorithmsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListAlgorithmsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SageMaker) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SageMakerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SageMaker | SageMakerClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sagemaker/pagination/ListAppsPaginator.ts b/clients/client-sagemaker/pagination/ListAppsPaginator.ts new file mode 100644 index 0000000000000..be34c91ceacb7 --- /dev/null +++ b/clients/client-sagemaker/pagination/ListAppsPaginator.ts @@ -0,0 +1,47 @@ +import { SageMaker } from "../SageMaker"; +import { SageMakerClient } from "../SageMakerClient"; +import { ListAppsCommand, ListAppsCommandInput, ListAppsCommandOutput } from "../commands/ListAppsCommand"; +import { SageMakerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SageMakerClient, + input: ListAppsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListAppsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SageMaker, + input: ListAppsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listApps(input, ...args); +}; +export async function* listAppsPaginate( + config: SageMakerPaginationConfiguration, + input: ListAppsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListAppsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SageMaker) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SageMakerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SageMaker | SageMakerClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sagemaker/pagination/ListAutoMLJobsPaginator.ts b/clients/client-sagemaker/pagination/ListAutoMLJobsPaginator.ts new file mode 100644 index 0000000000000..a383fa3844239 --- /dev/null +++ b/clients/client-sagemaker/pagination/ListAutoMLJobsPaginator.ts @@ -0,0 +1,51 @@ +import { SageMaker } from "../SageMaker"; +import { SageMakerClient } from "../SageMakerClient"; +import { + ListAutoMLJobsCommand, + ListAutoMLJobsCommandInput, + ListAutoMLJobsCommandOutput, +} from "../commands/ListAutoMLJobsCommand"; +import { SageMakerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SageMakerClient, + input: ListAutoMLJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListAutoMLJobsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SageMaker, + input: ListAutoMLJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listAutoMLJobs(input, ...args); +}; +export async function* listAutoMLJobsPaginate( + config: SageMakerPaginationConfiguration, + input: ListAutoMLJobsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListAutoMLJobsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SageMaker) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SageMakerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SageMaker | SageMakerClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sagemaker/pagination/ListCandidatesForAutoMLJobPaginator.ts b/clients/client-sagemaker/pagination/ListCandidatesForAutoMLJobPaginator.ts new file mode 100644 index 0000000000000..a55780ef18de2 --- /dev/null +++ b/clients/client-sagemaker/pagination/ListCandidatesForAutoMLJobPaginator.ts @@ -0,0 +1,51 @@ +import { SageMaker } from "../SageMaker"; +import { SageMakerClient } from "../SageMakerClient"; +import { + ListCandidatesForAutoMLJobCommand, + ListCandidatesForAutoMLJobCommandInput, + ListCandidatesForAutoMLJobCommandOutput, +} from "../commands/ListCandidatesForAutoMLJobCommand"; +import { SageMakerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SageMakerClient, + input: ListCandidatesForAutoMLJobCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListCandidatesForAutoMLJobCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SageMaker, + input: ListCandidatesForAutoMLJobCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listCandidatesForAutoMLJob(input, ...args); +}; +export async function* listCandidatesForAutoMLJobPaginate( + config: SageMakerPaginationConfiguration, + input: ListCandidatesForAutoMLJobCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListCandidatesForAutoMLJobCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SageMaker) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SageMakerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SageMaker | SageMakerClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sagemaker/pagination/ListCodeRepositoriesPaginator.ts b/clients/client-sagemaker/pagination/ListCodeRepositoriesPaginator.ts new file mode 100644 index 0000000000000..bd9b8ed21a529 --- /dev/null +++ b/clients/client-sagemaker/pagination/ListCodeRepositoriesPaginator.ts @@ -0,0 +1,51 @@ +import { SageMaker } from "../SageMaker"; +import { SageMakerClient } from "../SageMakerClient"; +import { + ListCodeRepositoriesCommand, + ListCodeRepositoriesCommandInput, + ListCodeRepositoriesCommandOutput, +} from "../commands/ListCodeRepositoriesCommand"; +import { SageMakerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SageMakerClient, + input: ListCodeRepositoriesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListCodeRepositoriesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SageMaker, + input: ListCodeRepositoriesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listCodeRepositories(input, ...args); +}; +export async function* listCodeRepositoriesPaginate( + config: SageMakerPaginationConfiguration, + input: ListCodeRepositoriesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListCodeRepositoriesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SageMaker) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SageMakerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SageMaker | SageMakerClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sagemaker/pagination/ListCompilationJobsPaginator.ts b/clients/client-sagemaker/pagination/ListCompilationJobsPaginator.ts new file mode 100644 index 0000000000000..e5aecb4aa7f28 --- /dev/null +++ b/clients/client-sagemaker/pagination/ListCompilationJobsPaginator.ts @@ -0,0 +1,51 @@ +import { SageMaker } from "../SageMaker"; +import { SageMakerClient } from "../SageMakerClient"; +import { + ListCompilationJobsCommand, + ListCompilationJobsCommandInput, + ListCompilationJobsCommandOutput, +} from "../commands/ListCompilationJobsCommand"; +import { SageMakerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SageMakerClient, + input: ListCompilationJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListCompilationJobsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SageMaker, + input: ListCompilationJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listCompilationJobs(input, ...args); +}; +export async function* listCompilationJobsPaginate( + config: SageMakerPaginationConfiguration, + input: ListCompilationJobsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListCompilationJobsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SageMaker) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SageMakerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SageMaker | SageMakerClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sagemaker/pagination/ListDomainsPaginator.ts b/clients/client-sagemaker/pagination/ListDomainsPaginator.ts new file mode 100644 index 0000000000000..e0963a6087c21 --- /dev/null +++ b/clients/client-sagemaker/pagination/ListDomainsPaginator.ts @@ -0,0 +1,47 @@ +import { SageMaker } from "../SageMaker"; +import { SageMakerClient } from "../SageMakerClient"; +import { ListDomainsCommand, ListDomainsCommandInput, ListDomainsCommandOutput } from "../commands/ListDomainsCommand"; +import { SageMakerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SageMakerClient, + input: ListDomainsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDomainsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SageMaker, + input: ListDomainsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDomains(input, ...args); +}; +export async function* listDomainsPaginate( + config: SageMakerPaginationConfiguration, + input: ListDomainsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDomainsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SageMaker) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SageMakerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SageMaker | SageMakerClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sagemaker/pagination/ListEndpointConfigsPaginator.ts b/clients/client-sagemaker/pagination/ListEndpointConfigsPaginator.ts new file mode 100644 index 0000000000000..ab7cbbe2d15fc --- /dev/null +++ b/clients/client-sagemaker/pagination/ListEndpointConfigsPaginator.ts @@ -0,0 +1,51 @@ +import { SageMaker } from "../SageMaker"; +import { SageMakerClient } from "../SageMakerClient"; +import { + ListEndpointConfigsCommand, + ListEndpointConfigsCommandInput, + ListEndpointConfigsCommandOutput, +} from "../commands/ListEndpointConfigsCommand"; +import { SageMakerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SageMakerClient, + input: ListEndpointConfigsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListEndpointConfigsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SageMaker, + input: ListEndpointConfigsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listEndpointConfigs(input, ...args); +}; +export async function* listEndpointConfigsPaginate( + config: SageMakerPaginationConfiguration, + input: ListEndpointConfigsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListEndpointConfigsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SageMaker) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SageMakerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SageMaker | SageMakerClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sagemaker/pagination/ListEndpointsPaginator.ts b/clients/client-sagemaker/pagination/ListEndpointsPaginator.ts new file mode 100644 index 0000000000000..77dd9583ca853 --- /dev/null +++ b/clients/client-sagemaker/pagination/ListEndpointsPaginator.ts @@ -0,0 +1,51 @@ +import { SageMaker } from "../SageMaker"; +import { SageMakerClient } from "../SageMakerClient"; +import { + ListEndpointsCommand, + ListEndpointsCommandInput, + ListEndpointsCommandOutput, +} from "../commands/ListEndpointsCommand"; +import { SageMakerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SageMakerClient, + input: ListEndpointsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListEndpointsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SageMaker, + input: ListEndpointsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listEndpoints(input, ...args); +}; +export async function* listEndpointsPaginate( + config: SageMakerPaginationConfiguration, + input: ListEndpointsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListEndpointsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SageMaker) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SageMakerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SageMaker | SageMakerClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sagemaker/pagination/ListExperimentsPaginator.ts b/clients/client-sagemaker/pagination/ListExperimentsPaginator.ts new file mode 100644 index 0000000000000..d26f2b6741657 --- /dev/null +++ b/clients/client-sagemaker/pagination/ListExperimentsPaginator.ts @@ -0,0 +1,51 @@ +import { SageMaker } from "../SageMaker"; +import { SageMakerClient } from "../SageMakerClient"; +import { + ListExperimentsCommand, + ListExperimentsCommandInput, + ListExperimentsCommandOutput, +} from "../commands/ListExperimentsCommand"; +import { SageMakerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SageMakerClient, + input: ListExperimentsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListExperimentsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SageMaker, + input: ListExperimentsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listExperiments(input, ...args); +}; +export async function* listExperimentsPaginate( + config: SageMakerPaginationConfiguration, + input: ListExperimentsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListExperimentsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SageMaker) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SageMakerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SageMaker | SageMakerClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sagemaker/pagination/ListFlowDefinitionsPaginator.ts b/clients/client-sagemaker/pagination/ListFlowDefinitionsPaginator.ts new file mode 100644 index 0000000000000..6558605816832 --- /dev/null +++ b/clients/client-sagemaker/pagination/ListFlowDefinitionsPaginator.ts @@ -0,0 +1,51 @@ +import { SageMaker } from "../SageMaker"; +import { SageMakerClient } from "../SageMakerClient"; +import { + ListFlowDefinitionsCommand, + ListFlowDefinitionsCommandInput, + ListFlowDefinitionsCommandOutput, +} from "../commands/ListFlowDefinitionsCommand"; +import { SageMakerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SageMakerClient, + input: ListFlowDefinitionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListFlowDefinitionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SageMaker, + input: ListFlowDefinitionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listFlowDefinitions(input, ...args); +}; +export async function* listFlowDefinitionsPaginate( + config: SageMakerPaginationConfiguration, + input: ListFlowDefinitionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListFlowDefinitionsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SageMaker) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SageMakerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SageMaker | SageMakerClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sagemaker/pagination/ListHumanTaskUisPaginator.ts b/clients/client-sagemaker/pagination/ListHumanTaskUisPaginator.ts new file mode 100644 index 0000000000000..1b9502cab3eeb --- /dev/null +++ b/clients/client-sagemaker/pagination/ListHumanTaskUisPaginator.ts @@ -0,0 +1,51 @@ +import { SageMaker } from "../SageMaker"; +import { SageMakerClient } from "../SageMakerClient"; +import { + ListHumanTaskUisCommand, + ListHumanTaskUisCommandInput, + ListHumanTaskUisCommandOutput, +} from "../commands/ListHumanTaskUisCommand"; +import { SageMakerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SageMakerClient, + input: ListHumanTaskUisCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListHumanTaskUisCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SageMaker, + input: ListHumanTaskUisCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listHumanTaskUis(input, ...args); +}; +export async function* listHumanTaskUisPaginate( + config: SageMakerPaginationConfiguration, + input: ListHumanTaskUisCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListHumanTaskUisCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SageMaker) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SageMakerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SageMaker | SageMakerClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sagemaker/pagination/ListHyperParameterTuningJobsPaginator.ts b/clients/client-sagemaker/pagination/ListHyperParameterTuningJobsPaginator.ts new file mode 100644 index 0000000000000..0b1fd4671bec0 --- /dev/null +++ b/clients/client-sagemaker/pagination/ListHyperParameterTuningJobsPaginator.ts @@ -0,0 +1,51 @@ +import { SageMaker } from "../SageMaker"; +import { SageMakerClient } from "../SageMakerClient"; +import { + ListHyperParameterTuningJobsCommand, + ListHyperParameterTuningJobsCommandInput, + ListHyperParameterTuningJobsCommandOutput, +} from "../commands/ListHyperParameterTuningJobsCommand"; +import { SageMakerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SageMakerClient, + input: ListHyperParameterTuningJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListHyperParameterTuningJobsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SageMaker, + input: ListHyperParameterTuningJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listHyperParameterTuningJobs(input, ...args); +}; +export async function* listHyperParameterTuningJobsPaginate( + config: SageMakerPaginationConfiguration, + input: ListHyperParameterTuningJobsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListHyperParameterTuningJobsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SageMaker) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SageMakerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SageMaker | SageMakerClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sagemaker/pagination/ListLabelingJobsForWorkteamPaginator.ts b/clients/client-sagemaker/pagination/ListLabelingJobsForWorkteamPaginator.ts new file mode 100644 index 0000000000000..c6480f9962289 --- /dev/null +++ b/clients/client-sagemaker/pagination/ListLabelingJobsForWorkteamPaginator.ts @@ -0,0 +1,51 @@ +import { SageMaker } from "../SageMaker"; +import { SageMakerClient } from "../SageMakerClient"; +import { + ListLabelingJobsForWorkteamCommand, + ListLabelingJobsForWorkteamCommandInput, + ListLabelingJobsForWorkteamCommandOutput, +} from "../commands/ListLabelingJobsForWorkteamCommand"; +import { SageMakerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SageMakerClient, + input: ListLabelingJobsForWorkteamCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListLabelingJobsForWorkteamCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SageMaker, + input: ListLabelingJobsForWorkteamCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listLabelingJobsForWorkteam(input, ...args); +}; +export async function* listLabelingJobsForWorkteamPaginate( + config: SageMakerPaginationConfiguration, + input: ListLabelingJobsForWorkteamCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListLabelingJobsForWorkteamCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SageMaker) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SageMakerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SageMaker | SageMakerClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sagemaker/pagination/ListLabelingJobsPaginator.ts b/clients/client-sagemaker/pagination/ListLabelingJobsPaginator.ts new file mode 100644 index 0000000000000..e321b919fc3f6 --- /dev/null +++ b/clients/client-sagemaker/pagination/ListLabelingJobsPaginator.ts @@ -0,0 +1,51 @@ +import { SageMaker } from "../SageMaker"; +import { SageMakerClient } from "../SageMakerClient"; +import { + ListLabelingJobsCommand, + ListLabelingJobsCommandInput, + ListLabelingJobsCommandOutput, +} from "../commands/ListLabelingJobsCommand"; +import { SageMakerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SageMakerClient, + input: ListLabelingJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListLabelingJobsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SageMaker, + input: ListLabelingJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listLabelingJobs(input, ...args); +}; +export async function* listLabelingJobsPaginate( + config: SageMakerPaginationConfiguration, + input: ListLabelingJobsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListLabelingJobsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SageMaker) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SageMakerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SageMaker | SageMakerClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sagemaker/pagination/ListModelPackagesPaginator.ts b/clients/client-sagemaker/pagination/ListModelPackagesPaginator.ts new file mode 100644 index 0000000000000..31915ec817e48 --- /dev/null +++ b/clients/client-sagemaker/pagination/ListModelPackagesPaginator.ts @@ -0,0 +1,51 @@ +import { SageMaker } from "../SageMaker"; +import { SageMakerClient } from "../SageMakerClient"; +import { + ListModelPackagesCommand, + ListModelPackagesCommandInput, + ListModelPackagesCommandOutput, +} from "../commands/ListModelPackagesCommand"; +import { SageMakerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SageMakerClient, + input: ListModelPackagesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListModelPackagesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SageMaker, + input: ListModelPackagesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listModelPackages(input, ...args); +}; +export async function* listModelPackagesPaginate( + config: SageMakerPaginationConfiguration, + input: ListModelPackagesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListModelPackagesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SageMaker) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SageMakerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SageMaker | SageMakerClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sagemaker/pagination/ListModelsPaginator.ts b/clients/client-sagemaker/pagination/ListModelsPaginator.ts new file mode 100644 index 0000000000000..1f06c6b1a545a --- /dev/null +++ b/clients/client-sagemaker/pagination/ListModelsPaginator.ts @@ -0,0 +1,47 @@ +import { SageMaker } from "../SageMaker"; +import { SageMakerClient } from "../SageMakerClient"; +import { ListModelsCommand, ListModelsCommandInput, ListModelsCommandOutput } from "../commands/ListModelsCommand"; +import { SageMakerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SageMakerClient, + input: ListModelsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListModelsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SageMaker, + input: ListModelsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listModels(input, ...args); +}; +export async function* listModelsPaginate( + config: SageMakerPaginationConfiguration, + input: ListModelsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListModelsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SageMaker) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SageMakerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SageMaker | SageMakerClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sagemaker/pagination/ListMonitoringExecutionsPaginator.ts b/clients/client-sagemaker/pagination/ListMonitoringExecutionsPaginator.ts new file mode 100644 index 0000000000000..00ba37f791755 --- /dev/null +++ b/clients/client-sagemaker/pagination/ListMonitoringExecutionsPaginator.ts @@ -0,0 +1,51 @@ +import { SageMaker } from "../SageMaker"; +import { SageMakerClient } from "../SageMakerClient"; +import { + ListMonitoringExecutionsCommand, + ListMonitoringExecutionsCommandInput, + ListMonitoringExecutionsCommandOutput, +} from "../commands/ListMonitoringExecutionsCommand"; +import { SageMakerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SageMakerClient, + input: ListMonitoringExecutionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListMonitoringExecutionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SageMaker, + input: ListMonitoringExecutionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listMonitoringExecutions(input, ...args); +}; +export async function* listMonitoringExecutionsPaginate( + config: SageMakerPaginationConfiguration, + input: ListMonitoringExecutionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListMonitoringExecutionsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SageMaker) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SageMakerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SageMaker | SageMakerClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sagemaker/pagination/ListMonitoringSchedulesPaginator.ts b/clients/client-sagemaker/pagination/ListMonitoringSchedulesPaginator.ts new file mode 100644 index 0000000000000..14d42b9f5c24b --- /dev/null +++ b/clients/client-sagemaker/pagination/ListMonitoringSchedulesPaginator.ts @@ -0,0 +1,51 @@ +import { SageMaker } from "../SageMaker"; +import { SageMakerClient } from "../SageMakerClient"; +import { + ListMonitoringSchedulesCommand, + ListMonitoringSchedulesCommandInput, + ListMonitoringSchedulesCommandOutput, +} from "../commands/ListMonitoringSchedulesCommand"; +import { SageMakerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SageMakerClient, + input: ListMonitoringSchedulesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListMonitoringSchedulesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SageMaker, + input: ListMonitoringSchedulesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listMonitoringSchedules(input, ...args); +}; +export async function* listMonitoringSchedulesPaginate( + config: SageMakerPaginationConfiguration, + input: ListMonitoringSchedulesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListMonitoringSchedulesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SageMaker) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SageMakerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SageMaker | SageMakerClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sagemaker/pagination/ListNotebookInstanceLifecycleConfigsPaginator.ts b/clients/client-sagemaker/pagination/ListNotebookInstanceLifecycleConfigsPaginator.ts new file mode 100644 index 0000000000000..5bc9c3747ef56 --- /dev/null +++ b/clients/client-sagemaker/pagination/ListNotebookInstanceLifecycleConfigsPaginator.ts @@ -0,0 +1,51 @@ +import { SageMaker } from "../SageMaker"; +import { SageMakerClient } from "../SageMakerClient"; +import { + ListNotebookInstanceLifecycleConfigsCommand, + ListNotebookInstanceLifecycleConfigsCommandInput, + ListNotebookInstanceLifecycleConfigsCommandOutput, +} from "../commands/ListNotebookInstanceLifecycleConfigsCommand"; +import { SageMakerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SageMakerClient, + input: ListNotebookInstanceLifecycleConfigsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListNotebookInstanceLifecycleConfigsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SageMaker, + input: ListNotebookInstanceLifecycleConfigsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listNotebookInstanceLifecycleConfigs(input, ...args); +}; +export async function* listNotebookInstanceLifecycleConfigsPaginate( + config: SageMakerPaginationConfiguration, + input: ListNotebookInstanceLifecycleConfigsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListNotebookInstanceLifecycleConfigsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SageMaker) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SageMakerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SageMaker | SageMakerClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sagemaker/pagination/ListNotebookInstancesPaginator.ts b/clients/client-sagemaker/pagination/ListNotebookInstancesPaginator.ts new file mode 100644 index 0000000000000..5fd80bb3a4a13 --- /dev/null +++ b/clients/client-sagemaker/pagination/ListNotebookInstancesPaginator.ts @@ -0,0 +1,51 @@ +import { SageMaker } from "../SageMaker"; +import { SageMakerClient } from "../SageMakerClient"; +import { + ListNotebookInstancesCommand, + ListNotebookInstancesCommandInput, + ListNotebookInstancesCommandOutput, +} from "../commands/ListNotebookInstancesCommand"; +import { SageMakerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SageMakerClient, + input: ListNotebookInstancesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListNotebookInstancesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SageMaker, + input: ListNotebookInstancesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listNotebookInstances(input, ...args); +}; +export async function* listNotebookInstancesPaginate( + config: SageMakerPaginationConfiguration, + input: ListNotebookInstancesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListNotebookInstancesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SageMaker) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SageMakerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SageMaker | SageMakerClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sagemaker/pagination/ListProcessingJobsPaginator.ts b/clients/client-sagemaker/pagination/ListProcessingJobsPaginator.ts new file mode 100644 index 0000000000000..72a38229dbdcc --- /dev/null +++ b/clients/client-sagemaker/pagination/ListProcessingJobsPaginator.ts @@ -0,0 +1,51 @@ +import { SageMaker } from "../SageMaker"; +import { SageMakerClient } from "../SageMakerClient"; +import { + ListProcessingJobsCommand, + ListProcessingJobsCommandInput, + ListProcessingJobsCommandOutput, +} from "../commands/ListProcessingJobsCommand"; +import { SageMakerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SageMakerClient, + input: ListProcessingJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListProcessingJobsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SageMaker, + input: ListProcessingJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listProcessingJobs(input, ...args); +}; +export async function* listProcessingJobsPaginate( + config: SageMakerPaginationConfiguration, + input: ListProcessingJobsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListProcessingJobsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SageMaker) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SageMakerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SageMaker | SageMakerClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sagemaker/pagination/ListSubscribedWorkteamsPaginator.ts b/clients/client-sagemaker/pagination/ListSubscribedWorkteamsPaginator.ts new file mode 100644 index 0000000000000..c04ecdb772627 --- /dev/null +++ b/clients/client-sagemaker/pagination/ListSubscribedWorkteamsPaginator.ts @@ -0,0 +1,51 @@ +import { SageMaker } from "../SageMaker"; +import { SageMakerClient } from "../SageMakerClient"; +import { + ListSubscribedWorkteamsCommand, + ListSubscribedWorkteamsCommandInput, + ListSubscribedWorkteamsCommandOutput, +} from "../commands/ListSubscribedWorkteamsCommand"; +import { SageMakerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SageMakerClient, + input: ListSubscribedWorkteamsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListSubscribedWorkteamsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SageMaker, + input: ListSubscribedWorkteamsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listSubscribedWorkteams(input, ...args); +}; +export async function* listSubscribedWorkteamsPaginate( + config: SageMakerPaginationConfiguration, + input: ListSubscribedWorkteamsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListSubscribedWorkteamsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SageMaker) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SageMakerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SageMaker | SageMakerClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sagemaker/pagination/ListTagsPaginator.ts b/clients/client-sagemaker/pagination/ListTagsPaginator.ts new file mode 100644 index 0000000000000..de15fc0562d35 --- /dev/null +++ b/clients/client-sagemaker/pagination/ListTagsPaginator.ts @@ -0,0 +1,47 @@ +import { SageMaker } from "../SageMaker"; +import { SageMakerClient } from "../SageMakerClient"; +import { ListTagsCommand, ListTagsCommandInput, ListTagsCommandOutput } from "../commands/ListTagsCommand"; +import { SageMakerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SageMakerClient, + input: ListTagsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTagsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SageMaker, + input: ListTagsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTags(input, ...args); +}; +export async function* listTagsPaginate( + config: SageMakerPaginationConfiguration, + input: ListTagsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTagsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SageMaker) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SageMakerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SageMaker | SageMakerClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sagemaker/pagination/ListTrainingJobsForHyperParameterTuningJobPaginator.ts b/clients/client-sagemaker/pagination/ListTrainingJobsForHyperParameterTuningJobPaginator.ts new file mode 100644 index 0000000000000..caec1146c71b4 --- /dev/null +++ b/clients/client-sagemaker/pagination/ListTrainingJobsForHyperParameterTuningJobPaginator.ts @@ -0,0 +1,51 @@ +import { SageMaker } from "../SageMaker"; +import { SageMakerClient } from "../SageMakerClient"; +import { + ListTrainingJobsForHyperParameterTuningJobCommand, + ListTrainingJobsForHyperParameterTuningJobCommandInput, + ListTrainingJobsForHyperParameterTuningJobCommandOutput, +} from "../commands/ListTrainingJobsForHyperParameterTuningJobCommand"; +import { SageMakerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SageMakerClient, + input: ListTrainingJobsForHyperParameterTuningJobCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTrainingJobsForHyperParameterTuningJobCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SageMaker, + input: ListTrainingJobsForHyperParameterTuningJobCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTrainingJobsForHyperParameterTuningJob(input, ...args); +}; +export async function* listTrainingJobsForHyperParameterTuningJobPaginate( + config: SageMakerPaginationConfiguration, + input: ListTrainingJobsForHyperParameterTuningJobCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTrainingJobsForHyperParameterTuningJobCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SageMaker) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SageMakerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SageMaker | SageMakerClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sagemaker/pagination/ListTrainingJobsPaginator.ts b/clients/client-sagemaker/pagination/ListTrainingJobsPaginator.ts new file mode 100644 index 0000000000000..7803faf344c62 --- /dev/null +++ b/clients/client-sagemaker/pagination/ListTrainingJobsPaginator.ts @@ -0,0 +1,51 @@ +import { SageMaker } from "../SageMaker"; +import { SageMakerClient } from "../SageMakerClient"; +import { + ListTrainingJobsCommand, + ListTrainingJobsCommandInput, + ListTrainingJobsCommandOutput, +} from "../commands/ListTrainingJobsCommand"; +import { SageMakerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SageMakerClient, + input: ListTrainingJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTrainingJobsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SageMaker, + input: ListTrainingJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTrainingJobs(input, ...args); +}; +export async function* listTrainingJobsPaginate( + config: SageMakerPaginationConfiguration, + input: ListTrainingJobsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTrainingJobsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SageMaker) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SageMakerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SageMaker | SageMakerClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sagemaker/pagination/ListTransformJobsPaginator.ts b/clients/client-sagemaker/pagination/ListTransformJobsPaginator.ts new file mode 100644 index 0000000000000..91f64246a3bf4 --- /dev/null +++ b/clients/client-sagemaker/pagination/ListTransformJobsPaginator.ts @@ -0,0 +1,51 @@ +import { SageMaker } from "../SageMaker"; +import { SageMakerClient } from "../SageMakerClient"; +import { + ListTransformJobsCommand, + ListTransformJobsCommandInput, + ListTransformJobsCommandOutput, +} from "../commands/ListTransformJobsCommand"; +import { SageMakerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SageMakerClient, + input: ListTransformJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTransformJobsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SageMaker, + input: ListTransformJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTransformJobs(input, ...args); +}; +export async function* listTransformJobsPaginate( + config: SageMakerPaginationConfiguration, + input: ListTransformJobsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTransformJobsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SageMaker) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SageMakerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SageMaker | SageMakerClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sagemaker/pagination/ListTrialComponentsPaginator.ts b/clients/client-sagemaker/pagination/ListTrialComponentsPaginator.ts new file mode 100644 index 0000000000000..3f4d70d2a7202 --- /dev/null +++ b/clients/client-sagemaker/pagination/ListTrialComponentsPaginator.ts @@ -0,0 +1,51 @@ +import { SageMaker } from "../SageMaker"; +import { SageMakerClient } from "../SageMakerClient"; +import { + ListTrialComponentsCommand, + ListTrialComponentsCommandInput, + ListTrialComponentsCommandOutput, +} from "../commands/ListTrialComponentsCommand"; +import { SageMakerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SageMakerClient, + input: ListTrialComponentsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTrialComponentsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SageMaker, + input: ListTrialComponentsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTrialComponents(input, ...args); +}; +export async function* listTrialComponentsPaginate( + config: SageMakerPaginationConfiguration, + input: ListTrialComponentsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTrialComponentsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SageMaker) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SageMakerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SageMaker | SageMakerClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sagemaker/pagination/ListTrialsPaginator.ts b/clients/client-sagemaker/pagination/ListTrialsPaginator.ts new file mode 100644 index 0000000000000..49792dfc28616 --- /dev/null +++ b/clients/client-sagemaker/pagination/ListTrialsPaginator.ts @@ -0,0 +1,47 @@ +import { SageMaker } from "../SageMaker"; +import { SageMakerClient } from "../SageMakerClient"; +import { ListTrialsCommand, ListTrialsCommandInput, ListTrialsCommandOutput } from "../commands/ListTrialsCommand"; +import { SageMakerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SageMakerClient, + input: ListTrialsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTrialsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SageMaker, + input: ListTrialsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTrials(input, ...args); +}; +export async function* listTrialsPaginate( + config: SageMakerPaginationConfiguration, + input: ListTrialsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTrialsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SageMaker) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SageMakerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SageMaker | SageMakerClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sagemaker/pagination/ListUserProfilesPaginator.ts b/clients/client-sagemaker/pagination/ListUserProfilesPaginator.ts new file mode 100644 index 0000000000000..34ba14539d611 --- /dev/null +++ b/clients/client-sagemaker/pagination/ListUserProfilesPaginator.ts @@ -0,0 +1,51 @@ +import { SageMaker } from "../SageMaker"; +import { SageMakerClient } from "../SageMakerClient"; +import { + ListUserProfilesCommand, + ListUserProfilesCommandInput, + ListUserProfilesCommandOutput, +} from "../commands/ListUserProfilesCommand"; +import { SageMakerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SageMakerClient, + input: ListUserProfilesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListUserProfilesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SageMaker, + input: ListUserProfilesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listUserProfiles(input, ...args); +}; +export async function* listUserProfilesPaginate( + config: SageMakerPaginationConfiguration, + input: ListUserProfilesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListUserProfilesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SageMaker) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SageMakerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SageMaker | SageMakerClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sagemaker/pagination/ListWorkforcesPaginator.ts b/clients/client-sagemaker/pagination/ListWorkforcesPaginator.ts new file mode 100644 index 0000000000000..871204e06a0ac --- /dev/null +++ b/clients/client-sagemaker/pagination/ListWorkforcesPaginator.ts @@ -0,0 +1,51 @@ +import { SageMaker } from "../SageMaker"; +import { SageMakerClient } from "../SageMakerClient"; +import { + ListWorkforcesCommand, + ListWorkforcesCommandInput, + ListWorkforcesCommandOutput, +} from "../commands/ListWorkforcesCommand"; +import { SageMakerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SageMakerClient, + input: ListWorkforcesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListWorkforcesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SageMaker, + input: ListWorkforcesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listWorkforces(input, ...args); +}; +export async function* listWorkforcesPaginate( + config: SageMakerPaginationConfiguration, + input: ListWorkforcesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListWorkforcesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SageMaker) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SageMakerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SageMaker | SageMakerClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sagemaker/pagination/ListWorkteamsPaginator.ts b/clients/client-sagemaker/pagination/ListWorkteamsPaginator.ts new file mode 100644 index 0000000000000..2a03fd15e9932 --- /dev/null +++ b/clients/client-sagemaker/pagination/ListWorkteamsPaginator.ts @@ -0,0 +1,51 @@ +import { SageMaker } from "../SageMaker"; +import { SageMakerClient } from "../SageMakerClient"; +import { + ListWorkteamsCommand, + ListWorkteamsCommandInput, + ListWorkteamsCommandOutput, +} from "../commands/ListWorkteamsCommand"; +import { SageMakerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SageMakerClient, + input: ListWorkteamsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListWorkteamsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SageMaker, + input: ListWorkteamsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listWorkteams(input, ...args); +}; +export async function* listWorkteamsPaginate( + config: SageMakerPaginationConfiguration, + input: ListWorkteamsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListWorkteamsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SageMaker) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SageMakerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SageMaker | SageMakerClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sagemaker/pagination/SearchPaginator.ts b/clients/client-sagemaker/pagination/SearchPaginator.ts new file mode 100644 index 0000000000000..915e6b73cedc6 --- /dev/null +++ b/clients/client-sagemaker/pagination/SearchPaginator.ts @@ -0,0 +1,47 @@ +import { SageMaker } from "../SageMaker"; +import { SageMakerClient } from "../SageMakerClient"; +import { SearchCommand, SearchCommandInput, SearchCommandOutput } from "../commands/SearchCommand"; +import { SageMakerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SageMakerClient, + input: SearchCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new SearchCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SageMaker, + input: SearchCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.search(input, ...args); +}; +export async function* searchPaginate( + config: SageMakerPaginationConfiguration, + input: SearchCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: SearchCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SageMaker) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SageMakerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SageMaker | SageMakerClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-secrets-manager/index.ts b/clients/client-secrets-manager/index.ts index 95b381dbc8d93..f9998c4044371 100644 --- a/clients/client-secrets-manager/index.ts +++ b/clients/client-secrets-manager/index.ts @@ -9,7 +9,9 @@ export * from "./commands/GetRandomPasswordCommand"; export * from "./commands/GetResourcePolicyCommand"; export * from "./commands/GetSecretValueCommand"; export * from "./commands/ListSecretsCommand"; +export * from "./pagination/ListSecretsPaginator"; export * from "./commands/ListSecretVersionIdsCommand"; +export * from "./pagination/ListSecretVersionIdsPaginator"; export * from "./commands/PutResourcePolicyCommand"; export * from "./commands/PutSecretValueCommand"; export * from "./commands/RestoreSecretCommand"; @@ -19,4 +21,5 @@ export * from "./commands/UntagResourceCommand"; export * from "./commands/UpdateSecretCommand"; export * from "./commands/UpdateSecretVersionStageCommand"; export * from "./commands/ValidateResourcePolicyCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-secrets-manager/pagination/Interfaces.ts b/clients/client-secrets-manager/pagination/Interfaces.ts new file mode 100644 index 0000000000000..866d04628417a --- /dev/null +++ b/clients/client-secrets-manager/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { SecretsManager } from "../SecretsManager"; +import { SecretsManagerClient } from "../SecretsManagerClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface SecretsManagerPaginationConfiguration extends PaginationConfiguration { + client: SecretsManager | SecretsManagerClient; +} diff --git a/clients/client-secrets-manager/pagination/ListSecretVersionIdsPaginator.ts b/clients/client-secrets-manager/pagination/ListSecretVersionIdsPaginator.ts new file mode 100644 index 0000000000000..8cbc3a974ffab --- /dev/null +++ b/clients/client-secrets-manager/pagination/ListSecretVersionIdsPaginator.ts @@ -0,0 +1,51 @@ +import { SecretsManager } from "../SecretsManager"; +import { SecretsManagerClient } from "../SecretsManagerClient"; +import { + ListSecretVersionIdsCommand, + ListSecretVersionIdsCommandInput, + ListSecretVersionIdsCommandOutput, +} from "../commands/ListSecretVersionIdsCommand"; +import { SecretsManagerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SecretsManagerClient, + input: ListSecretVersionIdsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListSecretVersionIdsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SecretsManager, + input: ListSecretVersionIdsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listSecretVersionIds(input, ...args); +}; +export async function* listSecretVersionIdsPaginate( + config: SecretsManagerPaginationConfiguration, + input: ListSecretVersionIdsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListSecretVersionIdsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SecretsManager) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SecretsManagerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SecretsManager | SecretsManagerClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-secrets-manager/pagination/ListSecretsPaginator.ts b/clients/client-secrets-manager/pagination/ListSecretsPaginator.ts new file mode 100644 index 0000000000000..f7e78764689a0 --- /dev/null +++ b/clients/client-secrets-manager/pagination/ListSecretsPaginator.ts @@ -0,0 +1,47 @@ +import { SecretsManager } from "../SecretsManager"; +import { SecretsManagerClient } from "../SecretsManagerClient"; +import { ListSecretsCommand, ListSecretsCommandInput, ListSecretsCommandOutput } from "../commands/ListSecretsCommand"; +import { SecretsManagerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SecretsManagerClient, + input: ListSecretsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListSecretsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SecretsManager, + input: ListSecretsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listSecrets(input, ...args); +}; +export async function* listSecretsPaginate( + config: SecretsManagerPaginationConfiguration, + input: ListSecretsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListSecretsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SecretsManager) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SecretsManagerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SecretsManager | SecretsManagerClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-securityhub/index.ts b/clients/client-securityhub/index.ts index 4d43677435cdb..5ec41518b6a2a 100644 --- a/clients/client-securityhub/index.ts +++ b/clients/client-securityhub/index.ts @@ -14,10 +14,14 @@ export * from "./commands/DeleteInsightCommand"; export * from "./commands/DeleteInvitationsCommand"; export * from "./commands/DeleteMembersCommand"; export * from "./commands/DescribeActionTargetsCommand"; +export * from "./pagination/DescribeActionTargetsPaginator"; export * from "./commands/DescribeHubCommand"; export * from "./commands/DescribeProductsCommand"; +export * from "./pagination/DescribeProductsPaginator"; export * from "./commands/DescribeStandardsCommand"; +export * from "./pagination/DescribeStandardsPaginator"; export * from "./commands/DescribeStandardsControlsCommand"; +export * from "./pagination/DescribeStandardsControlsPaginator"; export * from "./commands/DisableImportFindingsForProductCommand"; export * from "./commands/DisableSecurityHubCommand"; export * from "./commands/DisassociateFromMasterAccountCommand"; @@ -25,16 +29,22 @@ export * from "./commands/DisassociateMembersCommand"; export * from "./commands/EnableImportFindingsForProductCommand"; export * from "./commands/EnableSecurityHubCommand"; export * from "./commands/GetEnabledStandardsCommand"; +export * from "./pagination/GetEnabledStandardsPaginator"; export * from "./commands/GetFindingsCommand"; +export * from "./pagination/GetFindingsPaginator"; export * from "./commands/GetInsightResultsCommand"; export * from "./commands/GetInsightsCommand"; +export * from "./pagination/GetInsightsPaginator"; export * from "./commands/GetInvitationsCountCommand"; export * from "./commands/GetMasterAccountCommand"; export * from "./commands/GetMembersCommand"; export * from "./commands/InviteMembersCommand"; export * from "./commands/ListEnabledProductsForImportCommand"; +export * from "./pagination/ListEnabledProductsForImportPaginator"; export * from "./commands/ListInvitationsCommand"; +export * from "./pagination/ListInvitationsPaginator"; export * from "./commands/ListMembersCommand"; +export * from "./pagination/ListMembersPaginator"; export * from "./commands/ListTagsForResourceCommand"; export * from "./commands/TagResourceCommand"; export * from "./commands/UntagResourceCommand"; @@ -43,4 +53,5 @@ export * from "./commands/UpdateFindingsCommand"; export * from "./commands/UpdateInsightCommand"; export * from "./commands/UpdateSecurityHubConfigurationCommand"; export * from "./commands/UpdateStandardsControlCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-securityhub/pagination/DescribeActionTargetsPaginator.ts b/clients/client-securityhub/pagination/DescribeActionTargetsPaginator.ts new file mode 100644 index 0000000000000..f245410e10a98 --- /dev/null +++ b/clients/client-securityhub/pagination/DescribeActionTargetsPaginator.ts @@ -0,0 +1,51 @@ +import { SecurityHub } from "../SecurityHub"; +import { SecurityHubClient } from "../SecurityHubClient"; +import { + DescribeActionTargetsCommand, + DescribeActionTargetsCommandInput, + DescribeActionTargetsCommandOutput, +} from "../commands/DescribeActionTargetsCommand"; +import { SecurityHubPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SecurityHubClient, + input: DescribeActionTargetsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeActionTargetsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SecurityHub, + input: DescribeActionTargetsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeActionTargets(input, ...args); +}; +export async function* describeActionTargetsPaginate( + config: SecurityHubPaginationConfiguration, + input: DescribeActionTargetsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeActionTargetsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SecurityHub) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SecurityHubClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SecurityHub | SecurityHubClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-securityhub/pagination/DescribeProductsPaginator.ts b/clients/client-securityhub/pagination/DescribeProductsPaginator.ts new file mode 100644 index 0000000000000..ce739327e5ab3 --- /dev/null +++ b/clients/client-securityhub/pagination/DescribeProductsPaginator.ts @@ -0,0 +1,51 @@ +import { SecurityHub } from "../SecurityHub"; +import { SecurityHubClient } from "../SecurityHubClient"; +import { + DescribeProductsCommand, + DescribeProductsCommandInput, + DescribeProductsCommandOutput, +} from "../commands/DescribeProductsCommand"; +import { SecurityHubPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SecurityHubClient, + input: DescribeProductsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeProductsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SecurityHub, + input: DescribeProductsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeProducts(input, ...args); +}; +export async function* describeProductsPaginate( + config: SecurityHubPaginationConfiguration, + input: DescribeProductsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeProductsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SecurityHub) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SecurityHubClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SecurityHub | SecurityHubClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-securityhub/pagination/DescribeStandardsControlsPaginator.ts b/clients/client-securityhub/pagination/DescribeStandardsControlsPaginator.ts new file mode 100644 index 0000000000000..4a1a20bfed936 --- /dev/null +++ b/clients/client-securityhub/pagination/DescribeStandardsControlsPaginator.ts @@ -0,0 +1,51 @@ +import { SecurityHub } from "../SecurityHub"; +import { SecurityHubClient } from "../SecurityHubClient"; +import { + DescribeStandardsControlsCommand, + DescribeStandardsControlsCommandInput, + DescribeStandardsControlsCommandOutput, +} from "../commands/DescribeStandardsControlsCommand"; +import { SecurityHubPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SecurityHubClient, + input: DescribeStandardsControlsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeStandardsControlsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SecurityHub, + input: DescribeStandardsControlsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeStandardsControls(input, ...args); +}; +export async function* describeStandardsControlsPaginate( + config: SecurityHubPaginationConfiguration, + input: DescribeStandardsControlsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeStandardsControlsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SecurityHub) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SecurityHubClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SecurityHub | SecurityHubClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-securityhub/pagination/DescribeStandardsPaginator.ts b/clients/client-securityhub/pagination/DescribeStandardsPaginator.ts new file mode 100644 index 0000000000000..c61904cf71d0f --- /dev/null +++ b/clients/client-securityhub/pagination/DescribeStandardsPaginator.ts @@ -0,0 +1,51 @@ +import { SecurityHub } from "../SecurityHub"; +import { SecurityHubClient } from "../SecurityHubClient"; +import { + DescribeStandardsCommand, + DescribeStandardsCommandInput, + DescribeStandardsCommandOutput, +} from "../commands/DescribeStandardsCommand"; +import { SecurityHubPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SecurityHubClient, + input: DescribeStandardsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeStandardsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SecurityHub, + input: DescribeStandardsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeStandards(input, ...args); +}; +export async function* describeStandardsPaginate( + config: SecurityHubPaginationConfiguration, + input: DescribeStandardsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeStandardsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SecurityHub) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SecurityHubClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SecurityHub | SecurityHubClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-securityhub/pagination/GetEnabledStandardsPaginator.ts b/clients/client-securityhub/pagination/GetEnabledStandardsPaginator.ts new file mode 100644 index 0000000000000..d53adea4d3a87 --- /dev/null +++ b/clients/client-securityhub/pagination/GetEnabledStandardsPaginator.ts @@ -0,0 +1,51 @@ +import { SecurityHub } from "../SecurityHub"; +import { SecurityHubClient } from "../SecurityHubClient"; +import { + GetEnabledStandardsCommand, + GetEnabledStandardsCommandInput, + GetEnabledStandardsCommandOutput, +} from "../commands/GetEnabledStandardsCommand"; +import { SecurityHubPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SecurityHubClient, + input: GetEnabledStandardsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetEnabledStandardsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SecurityHub, + input: GetEnabledStandardsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getEnabledStandards(input, ...args); +}; +export async function* getEnabledStandardsPaginate( + config: SecurityHubPaginationConfiguration, + input: GetEnabledStandardsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetEnabledStandardsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SecurityHub) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SecurityHubClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SecurityHub | SecurityHubClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-securityhub/pagination/GetFindingsPaginator.ts b/clients/client-securityhub/pagination/GetFindingsPaginator.ts new file mode 100644 index 0000000000000..a0d5c1ec191e2 --- /dev/null +++ b/clients/client-securityhub/pagination/GetFindingsPaginator.ts @@ -0,0 +1,47 @@ +import { SecurityHub } from "../SecurityHub"; +import { SecurityHubClient } from "../SecurityHubClient"; +import { GetFindingsCommand, GetFindingsCommandInput, GetFindingsCommandOutput } from "../commands/GetFindingsCommand"; +import { SecurityHubPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SecurityHubClient, + input: GetFindingsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetFindingsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SecurityHub, + input: GetFindingsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getFindings(input, ...args); +}; +export async function* getFindingsPaginate( + config: SecurityHubPaginationConfiguration, + input: GetFindingsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetFindingsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SecurityHub) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SecurityHubClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SecurityHub | SecurityHubClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-securityhub/pagination/GetInsightsPaginator.ts b/clients/client-securityhub/pagination/GetInsightsPaginator.ts new file mode 100644 index 0000000000000..94b0bd25fe270 --- /dev/null +++ b/clients/client-securityhub/pagination/GetInsightsPaginator.ts @@ -0,0 +1,47 @@ +import { SecurityHub } from "../SecurityHub"; +import { SecurityHubClient } from "../SecurityHubClient"; +import { GetInsightsCommand, GetInsightsCommandInput, GetInsightsCommandOutput } from "../commands/GetInsightsCommand"; +import { SecurityHubPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SecurityHubClient, + input: GetInsightsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetInsightsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SecurityHub, + input: GetInsightsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getInsights(input, ...args); +}; +export async function* getInsightsPaginate( + config: SecurityHubPaginationConfiguration, + input: GetInsightsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetInsightsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SecurityHub) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SecurityHubClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SecurityHub | SecurityHubClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-securityhub/pagination/Interfaces.ts b/clients/client-securityhub/pagination/Interfaces.ts new file mode 100644 index 0000000000000..40debe64b41b0 --- /dev/null +++ b/clients/client-securityhub/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { SecurityHub } from "../SecurityHub"; +import { SecurityHubClient } from "../SecurityHubClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface SecurityHubPaginationConfiguration extends PaginationConfiguration { + client: SecurityHub | SecurityHubClient; +} diff --git a/clients/client-securityhub/pagination/ListEnabledProductsForImportPaginator.ts b/clients/client-securityhub/pagination/ListEnabledProductsForImportPaginator.ts new file mode 100644 index 0000000000000..e344d1751743a --- /dev/null +++ b/clients/client-securityhub/pagination/ListEnabledProductsForImportPaginator.ts @@ -0,0 +1,51 @@ +import { SecurityHub } from "../SecurityHub"; +import { SecurityHubClient } from "../SecurityHubClient"; +import { + ListEnabledProductsForImportCommand, + ListEnabledProductsForImportCommandInput, + ListEnabledProductsForImportCommandOutput, +} from "../commands/ListEnabledProductsForImportCommand"; +import { SecurityHubPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SecurityHubClient, + input: ListEnabledProductsForImportCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListEnabledProductsForImportCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SecurityHub, + input: ListEnabledProductsForImportCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listEnabledProductsForImport(input, ...args); +}; +export async function* listEnabledProductsForImportPaginate( + config: SecurityHubPaginationConfiguration, + input: ListEnabledProductsForImportCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListEnabledProductsForImportCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SecurityHub) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SecurityHubClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SecurityHub | SecurityHubClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-securityhub/pagination/ListInvitationsPaginator.ts b/clients/client-securityhub/pagination/ListInvitationsPaginator.ts new file mode 100644 index 0000000000000..63763b6b6e043 --- /dev/null +++ b/clients/client-securityhub/pagination/ListInvitationsPaginator.ts @@ -0,0 +1,51 @@ +import { SecurityHub } from "../SecurityHub"; +import { SecurityHubClient } from "../SecurityHubClient"; +import { + ListInvitationsCommand, + ListInvitationsCommandInput, + ListInvitationsCommandOutput, +} from "../commands/ListInvitationsCommand"; +import { SecurityHubPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SecurityHubClient, + input: ListInvitationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListInvitationsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SecurityHub, + input: ListInvitationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listInvitations(input, ...args); +}; +export async function* listInvitationsPaginate( + config: SecurityHubPaginationConfiguration, + input: ListInvitationsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListInvitationsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SecurityHub) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SecurityHubClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SecurityHub | SecurityHubClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-securityhub/pagination/ListMembersPaginator.ts b/clients/client-securityhub/pagination/ListMembersPaginator.ts new file mode 100644 index 0000000000000..8f72c52faea63 --- /dev/null +++ b/clients/client-securityhub/pagination/ListMembersPaginator.ts @@ -0,0 +1,47 @@ +import { SecurityHub } from "../SecurityHub"; +import { SecurityHubClient } from "../SecurityHubClient"; +import { ListMembersCommand, ListMembersCommandInput, ListMembersCommandOutput } from "../commands/ListMembersCommand"; +import { SecurityHubPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SecurityHubClient, + input: ListMembersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListMembersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SecurityHub, + input: ListMembersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listMembers(input, ...args); +}; +export async function* listMembersPaginate( + config: SecurityHubPaginationConfiguration, + input: ListMembersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListMembersCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SecurityHub) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SecurityHubClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SecurityHub | SecurityHubClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-service-catalog/index.ts b/clients/client-service-catalog/index.ts index ebd24aaf01450..492b0925a3edb 100644 --- a/clients/client-service-catalog/index.ts +++ b/clients/client-service-catalog/index.ts @@ -51,29 +51,46 @@ export * from "./commands/ExecuteProvisionedProductPlanCommand"; export * from "./commands/ExecuteProvisionedProductServiceActionCommand"; export * from "./commands/GetAWSOrganizationsAccessStatusCommand"; export * from "./commands/ListAcceptedPortfolioSharesCommand"; +export * from "./pagination/ListAcceptedPortfolioSharesPaginator"; export * from "./commands/ListBudgetsForResourceCommand"; +export * from "./pagination/ListBudgetsForResourcePaginator"; export * from "./commands/ListConstraintsForPortfolioCommand"; +export * from "./pagination/ListConstraintsForPortfolioPaginator"; export * from "./commands/ListLaunchPathsCommand"; +export * from "./pagination/ListLaunchPathsPaginator"; export * from "./commands/ListOrganizationPortfolioAccessCommand"; +export * from "./pagination/ListOrganizationPortfolioAccessPaginator"; export * from "./commands/ListPortfolioAccessCommand"; +export * from "./pagination/ListPortfolioAccessPaginator"; export * from "./commands/ListPortfoliosCommand"; +export * from "./pagination/ListPortfoliosPaginator"; export * from "./commands/ListPortfoliosForProductCommand"; +export * from "./pagination/ListPortfoliosForProductPaginator"; export * from "./commands/ListPrincipalsForPortfolioCommand"; +export * from "./pagination/ListPrincipalsForPortfolioPaginator"; export * from "./commands/ListProvisionedProductPlansCommand"; export * from "./commands/ListProvisioningArtifactsCommand"; export * from "./commands/ListProvisioningArtifactsForServiceActionCommand"; +export * from "./pagination/ListProvisioningArtifactsForServiceActionPaginator"; export * from "./commands/ListRecordHistoryCommand"; export * from "./commands/ListResourcesForTagOptionCommand"; +export * from "./pagination/ListResourcesForTagOptionPaginator"; export * from "./commands/ListServiceActionsCommand"; +export * from "./pagination/ListServiceActionsPaginator"; export * from "./commands/ListServiceActionsForProvisioningArtifactCommand"; +export * from "./pagination/ListServiceActionsForProvisioningArtifactPaginator"; export * from "./commands/ListStackInstancesForProvisionedProductCommand"; export * from "./commands/ListTagOptionsCommand"; +export * from "./pagination/ListTagOptionsPaginator"; export * from "./commands/ProvisionProductCommand"; export * from "./commands/RejectPortfolioShareCommand"; export * from "./commands/ScanProvisionedProductsCommand"; export * from "./commands/SearchProductsCommand"; +export * from "./pagination/SearchProductsPaginator"; export * from "./commands/SearchProductsAsAdminCommand"; +export * from "./pagination/SearchProductsAsAdminPaginator"; export * from "./commands/SearchProvisionedProductsCommand"; +export * from "./pagination/SearchProvisionedProductsPaginator"; export * from "./commands/TerminateProvisionedProductCommand"; export * from "./commands/UpdateConstraintCommand"; export * from "./commands/UpdatePortfolioCommand"; @@ -83,4 +100,5 @@ export * from "./commands/UpdateProvisionedProductPropertiesCommand"; export * from "./commands/UpdateProvisioningArtifactCommand"; export * from "./commands/UpdateServiceActionCommand"; export * from "./commands/UpdateTagOptionCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-service-catalog/pagination/Interfaces.ts b/clients/client-service-catalog/pagination/Interfaces.ts new file mode 100644 index 0000000000000..0e69adbfa27fa --- /dev/null +++ b/clients/client-service-catalog/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { ServiceCatalog } from "../ServiceCatalog"; +import { ServiceCatalogClient } from "../ServiceCatalogClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface ServiceCatalogPaginationConfiguration extends PaginationConfiguration { + client: ServiceCatalog | ServiceCatalogClient; +} diff --git a/clients/client-service-catalog/pagination/ListAcceptedPortfolioSharesPaginator.ts b/clients/client-service-catalog/pagination/ListAcceptedPortfolioSharesPaginator.ts new file mode 100644 index 0000000000000..6639bb5e9e9dd --- /dev/null +++ b/clients/client-service-catalog/pagination/ListAcceptedPortfolioSharesPaginator.ts @@ -0,0 +1,51 @@ +import { ServiceCatalog } from "../ServiceCatalog"; +import { ServiceCatalogClient } from "../ServiceCatalogClient"; +import { + ListAcceptedPortfolioSharesCommand, + ListAcceptedPortfolioSharesCommandInput, + ListAcceptedPortfolioSharesCommandOutput, +} from "../commands/ListAcceptedPortfolioSharesCommand"; +import { ServiceCatalogPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ServiceCatalogClient, + input: ListAcceptedPortfolioSharesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListAcceptedPortfolioSharesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ServiceCatalog, + input: ListAcceptedPortfolioSharesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listAcceptedPortfolioShares(input, ...args); +}; +export async function* listAcceptedPortfolioSharesPaginate( + config: ServiceCatalogPaginationConfiguration, + input: ListAcceptedPortfolioSharesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListAcceptedPortfolioSharesCommandOutput; + while (hasNext) { + input["PageToken"] = token; + input["PageSize"] = config.pageSize; + if (config.client instanceof ServiceCatalog) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ServiceCatalogClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ServiceCatalog | ServiceCatalogClient"); + } + yield page; + token = page["NextPageToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-service-catalog/pagination/ListBudgetsForResourcePaginator.ts b/clients/client-service-catalog/pagination/ListBudgetsForResourcePaginator.ts new file mode 100644 index 0000000000000..27df491c14a8b --- /dev/null +++ b/clients/client-service-catalog/pagination/ListBudgetsForResourcePaginator.ts @@ -0,0 +1,51 @@ +import { ServiceCatalog } from "../ServiceCatalog"; +import { ServiceCatalogClient } from "../ServiceCatalogClient"; +import { + ListBudgetsForResourceCommand, + ListBudgetsForResourceCommandInput, + ListBudgetsForResourceCommandOutput, +} from "../commands/ListBudgetsForResourceCommand"; +import { ServiceCatalogPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ServiceCatalogClient, + input: ListBudgetsForResourceCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListBudgetsForResourceCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ServiceCatalog, + input: ListBudgetsForResourceCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listBudgetsForResource(input, ...args); +}; +export async function* listBudgetsForResourcePaginate( + config: ServiceCatalogPaginationConfiguration, + input: ListBudgetsForResourceCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListBudgetsForResourceCommandOutput; + while (hasNext) { + input["PageToken"] = token; + input["PageSize"] = config.pageSize; + if (config.client instanceof ServiceCatalog) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ServiceCatalogClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ServiceCatalog | ServiceCatalogClient"); + } + yield page; + token = page["NextPageToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-service-catalog/pagination/ListConstraintsForPortfolioPaginator.ts b/clients/client-service-catalog/pagination/ListConstraintsForPortfolioPaginator.ts new file mode 100644 index 0000000000000..d6714fd450dff --- /dev/null +++ b/clients/client-service-catalog/pagination/ListConstraintsForPortfolioPaginator.ts @@ -0,0 +1,51 @@ +import { ServiceCatalog } from "../ServiceCatalog"; +import { ServiceCatalogClient } from "../ServiceCatalogClient"; +import { + ListConstraintsForPortfolioCommand, + ListConstraintsForPortfolioCommandInput, + ListConstraintsForPortfolioCommandOutput, +} from "../commands/ListConstraintsForPortfolioCommand"; +import { ServiceCatalogPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ServiceCatalogClient, + input: ListConstraintsForPortfolioCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListConstraintsForPortfolioCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ServiceCatalog, + input: ListConstraintsForPortfolioCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listConstraintsForPortfolio(input, ...args); +}; +export async function* listConstraintsForPortfolioPaginate( + config: ServiceCatalogPaginationConfiguration, + input: ListConstraintsForPortfolioCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListConstraintsForPortfolioCommandOutput; + while (hasNext) { + input["PageToken"] = token; + input["PageSize"] = config.pageSize; + if (config.client instanceof ServiceCatalog) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ServiceCatalogClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ServiceCatalog | ServiceCatalogClient"); + } + yield page; + token = page["NextPageToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-service-catalog/pagination/ListLaunchPathsPaginator.ts b/clients/client-service-catalog/pagination/ListLaunchPathsPaginator.ts new file mode 100644 index 0000000000000..00066902e3ab7 --- /dev/null +++ b/clients/client-service-catalog/pagination/ListLaunchPathsPaginator.ts @@ -0,0 +1,51 @@ +import { ServiceCatalog } from "../ServiceCatalog"; +import { ServiceCatalogClient } from "../ServiceCatalogClient"; +import { + ListLaunchPathsCommand, + ListLaunchPathsCommandInput, + ListLaunchPathsCommandOutput, +} from "../commands/ListLaunchPathsCommand"; +import { ServiceCatalogPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ServiceCatalogClient, + input: ListLaunchPathsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListLaunchPathsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ServiceCatalog, + input: ListLaunchPathsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listLaunchPaths(input, ...args); +}; +export async function* listLaunchPathsPaginate( + config: ServiceCatalogPaginationConfiguration, + input: ListLaunchPathsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListLaunchPathsCommandOutput; + while (hasNext) { + input["PageToken"] = token; + input["PageSize"] = config.pageSize; + if (config.client instanceof ServiceCatalog) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ServiceCatalogClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ServiceCatalog | ServiceCatalogClient"); + } + yield page; + token = page["NextPageToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-service-catalog/pagination/ListOrganizationPortfolioAccessPaginator.ts b/clients/client-service-catalog/pagination/ListOrganizationPortfolioAccessPaginator.ts new file mode 100644 index 0000000000000..a4c583a1223b7 --- /dev/null +++ b/clients/client-service-catalog/pagination/ListOrganizationPortfolioAccessPaginator.ts @@ -0,0 +1,51 @@ +import { ServiceCatalog } from "../ServiceCatalog"; +import { ServiceCatalogClient } from "../ServiceCatalogClient"; +import { + ListOrganizationPortfolioAccessCommand, + ListOrganizationPortfolioAccessCommandInput, + ListOrganizationPortfolioAccessCommandOutput, +} from "../commands/ListOrganizationPortfolioAccessCommand"; +import { ServiceCatalogPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ServiceCatalogClient, + input: ListOrganizationPortfolioAccessCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListOrganizationPortfolioAccessCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ServiceCatalog, + input: ListOrganizationPortfolioAccessCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listOrganizationPortfolioAccess(input, ...args); +}; +export async function* listOrganizationPortfolioAccessPaginate( + config: ServiceCatalogPaginationConfiguration, + input: ListOrganizationPortfolioAccessCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListOrganizationPortfolioAccessCommandOutput; + while (hasNext) { + input["PageToken"] = token; + input["PageSize"] = config.pageSize; + if (config.client instanceof ServiceCatalog) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ServiceCatalogClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ServiceCatalog | ServiceCatalogClient"); + } + yield page; + token = page["NextPageToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-service-catalog/pagination/ListPortfolioAccessPaginator.ts b/clients/client-service-catalog/pagination/ListPortfolioAccessPaginator.ts new file mode 100644 index 0000000000000..d0ffdace6aa02 --- /dev/null +++ b/clients/client-service-catalog/pagination/ListPortfolioAccessPaginator.ts @@ -0,0 +1,51 @@ +import { ServiceCatalog } from "../ServiceCatalog"; +import { ServiceCatalogClient } from "../ServiceCatalogClient"; +import { + ListPortfolioAccessCommand, + ListPortfolioAccessCommandInput, + ListPortfolioAccessCommandOutput, +} from "../commands/ListPortfolioAccessCommand"; +import { ServiceCatalogPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ServiceCatalogClient, + input: ListPortfolioAccessCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListPortfolioAccessCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ServiceCatalog, + input: ListPortfolioAccessCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listPortfolioAccess(input, ...args); +}; +export async function* listPortfolioAccessPaginate( + config: ServiceCatalogPaginationConfiguration, + input: ListPortfolioAccessCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListPortfolioAccessCommandOutput; + while (hasNext) { + input["PageToken"] = token; + input["PageSize"] = config.pageSize; + if (config.client instanceof ServiceCatalog) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ServiceCatalogClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ServiceCatalog | ServiceCatalogClient"); + } + yield page; + token = page["NextPageToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-service-catalog/pagination/ListPortfoliosForProductPaginator.ts b/clients/client-service-catalog/pagination/ListPortfoliosForProductPaginator.ts new file mode 100644 index 0000000000000..4e2e56e4d832d --- /dev/null +++ b/clients/client-service-catalog/pagination/ListPortfoliosForProductPaginator.ts @@ -0,0 +1,51 @@ +import { ServiceCatalog } from "../ServiceCatalog"; +import { ServiceCatalogClient } from "../ServiceCatalogClient"; +import { + ListPortfoliosForProductCommand, + ListPortfoliosForProductCommandInput, + ListPortfoliosForProductCommandOutput, +} from "../commands/ListPortfoliosForProductCommand"; +import { ServiceCatalogPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ServiceCatalogClient, + input: ListPortfoliosForProductCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListPortfoliosForProductCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ServiceCatalog, + input: ListPortfoliosForProductCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listPortfoliosForProduct(input, ...args); +}; +export async function* listPortfoliosForProductPaginate( + config: ServiceCatalogPaginationConfiguration, + input: ListPortfoliosForProductCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListPortfoliosForProductCommandOutput; + while (hasNext) { + input["PageToken"] = token; + input["PageSize"] = config.pageSize; + if (config.client instanceof ServiceCatalog) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ServiceCatalogClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ServiceCatalog | ServiceCatalogClient"); + } + yield page; + token = page["NextPageToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-service-catalog/pagination/ListPortfoliosPaginator.ts b/clients/client-service-catalog/pagination/ListPortfoliosPaginator.ts new file mode 100644 index 0000000000000..37c8296fdc54d --- /dev/null +++ b/clients/client-service-catalog/pagination/ListPortfoliosPaginator.ts @@ -0,0 +1,51 @@ +import { ServiceCatalog } from "../ServiceCatalog"; +import { ServiceCatalogClient } from "../ServiceCatalogClient"; +import { + ListPortfoliosCommand, + ListPortfoliosCommandInput, + ListPortfoliosCommandOutput, +} from "../commands/ListPortfoliosCommand"; +import { ServiceCatalogPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ServiceCatalogClient, + input: ListPortfoliosCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListPortfoliosCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ServiceCatalog, + input: ListPortfoliosCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listPortfolios(input, ...args); +}; +export async function* listPortfoliosPaginate( + config: ServiceCatalogPaginationConfiguration, + input: ListPortfoliosCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListPortfoliosCommandOutput; + while (hasNext) { + input["PageToken"] = token; + input["PageSize"] = config.pageSize; + if (config.client instanceof ServiceCatalog) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ServiceCatalogClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ServiceCatalog | ServiceCatalogClient"); + } + yield page; + token = page["NextPageToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-service-catalog/pagination/ListPrincipalsForPortfolioPaginator.ts b/clients/client-service-catalog/pagination/ListPrincipalsForPortfolioPaginator.ts new file mode 100644 index 0000000000000..07c17231424d7 --- /dev/null +++ b/clients/client-service-catalog/pagination/ListPrincipalsForPortfolioPaginator.ts @@ -0,0 +1,51 @@ +import { ServiceCatalog } from "../ServiceCatalog"; +import { ServiceCatalogClient } from "../ServiceCatalogClient"; +import { + ListPrincipalsForPortfolioCommand, + ListPrincipalsForPortfolioCommandInput, + ListPrincipalsForPortfolioCommandOutput, +} from "../commands/ListPrincipalsForPortfolioCommand"; +import { ServiceCatalogPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ServiceCatalogClient, + input: ListPrincipalsForPortfolioCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListPrincipalsForPortfolioCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ServiceCatalog, + input: ListPrincipalsForPortfolioCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listPrincipalsForPortfolio(input, ...args); +}; +export async function* listPrincipalsForPortfolioPaginate( + config: ServiceCatalogPaginationConfiguration, + input: ListPrincipalsForPortfolioCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListPrincipalsForPortfolioCommandOutput; + while (hasNext) { + input["PageToken"] = token; + input["PageSize"] = config.pageSize; + if (config.client instanceof ServiceCatalog) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ServiceCatalogClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ServiceCatalog | ServiceCatalogClient"); + } + yield page; + token = page["NextPageToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-service-catalog/pagination/ListProvisioningArtifactsForServiceActionPaginator.ts b/clients/client-service-catalog/pagination/ListProvisioningArtifactsForServiceActionPaginator.ts new file mode 100644 index 0000000000000..146bd0bdd675e --- /dev/null +++ b/clients/client-service-catalog/pagination/ListProvisioningArtifactsForServiceActionPaginator.ts @@ -0,0 +1,51 @@ +import { ServiceCatalog } from "../ServiceCatalog"; +import { ServiceCatalogClient } from "../ServiceCatalogClient"; +import { + ListProvisioningArtifactsForServiceActionCommand, + ListProvisioningArtifactsForServiceActionCommandInput, + ListProvisioningArtifactsForServiceActionCommandOutput, +} from "../commands/ListProvisioningArtifactsForServiceActionCommand"; +import { ServiceCatalogPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ServiceCatalogClient, + input: ListProvisioningArtifactsForServiceActionCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListProvisioningArtifactsForServiceActionCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ServiceCatalog, + input: ListProvisioningArtifactsForServiceActionCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listProvisioningArtifactsForServiceAction(input, ...args); +}; +export async function* listProvisioningArtifactsForServiceActionPaginate( + config: ServiceCatalogPaginationConfiguration, + input: ListProvisioningArtifactsForServiceActionCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListProvisioningArtifactsForServiceActionCommandOutput; + while (hasNext) { + input["PageToken"] = token; + input["PageSize"] = config.pageSize; + if (config.client instanceof ServiceCatalog) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ServiceCatalogClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ServiceCatalog | ServiceCatalogClient"); + } + yield page; + token = page["NextPageToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-service-catalog/pagination/ListResourcesForTagOptionPaginator.ts b/clients/client-service-catalog/pagination/ListResourcesForTagOptionPaginator.ts new file mode 100644 index 0000000000000..2ff973856222c --- /dev/null +++ b/clients/client-service-catalog/pagination/ListResourcesForTagOptionPaginator.ts @@ -0,0 +1,51 @@ +import { ServiceCatalog } from "../ServiceCatalog"; +import { ServiceCatalogClient } from "../ServiceCatalogClient"; +import { + ListResourcesForTagOptionCommand, + ListResourcesForTagOptionCommandInput, + ListResourcesForTagOptionCommandOutput, +} from "../commands/ListResourcesForTagOptionCommand"; +import { ServiceCatalogPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ServiceCatalogClient, + input: ListResourcesForTagOptionCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListResourcesForTagOptionCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ServiceCatalog, + input: ListResourcesForTagOptionCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listResourcesForTagOption(input, ...args); +}; +export async function* listResourcesForTagOptionPaginate( + config: ServiceCatalogPaginationConfiguration, + input: ListResourcesForTagOptionCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListResourcesForTagOptionCommandOutput; + while (hasNext) { + input["PageToken"] = token; + input["PageSize"] = config.pageSize; + if (config.client instanceof ServiceCatalog) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ServiceCatalogClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ServiceCatalog | ServiceCatalogClient"); + } + yield page; + token = page["PageToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-service-catalog/pagination/ListServiceActionsForProvisioningArtifactPaginator.ts b/clients/client-service-catalog/pagination/ListServiceActionsForProvisioningArtifactPaginator.ts new file mode 100644 index 0000000000000..66464c23b0734 --- /dev/null +++ b/clients/client-service-catalog/pagination/ListServiceActionsForProvisioningArtifactPaginator.ts @@ -0,0 +1,51 @@ +import { ServiceCatalog } from "../ServiceCatalog"; +import { ServiceCatalogClient } from "../ServiceCatalogClient"; +import { + ListServiceActionsForProvisioningArtifactCommand, + ListServiceActionsForProvisioningArtifactCommandInput, + ListServiceActionsForProvisioningArtifactCommandOutput, +} from "../commands/ListServiceActionsForProvisioningArtifactCommand"; +import { ServiceCatalogPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ServiceCatalogClient, + input: ListServiceActionsForProvisioningArtifactCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListServiceActionsForProvisioningArtifactCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ServiceCatalog, + input: ListServiceActionsForProvisioningArtifactCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listServiceActionsForProvisioningArtifact(input, ...args); +}; +export async function* listServiceActionsForProvisioningArtifactPaginate( + config: ServiceCatalogPaginationConfiguration, + input: ListServiceActionsForProvisioningArtifactCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListServiceActionsForProvisioningArtifactCommandOutput; + while (hasNext) { + input["PageToken"] = token; + input["PageSize"] = config.pageSize; + if (config.client instanceof ServiceCatalog) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ServiceCatalogClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ServiceCatalog | ServiceCatalogClient"); + } + yield page; + token = page["NextPageToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-service-catalog/pagination/ListServiceActionsPaginator.ts b/clients/client-service-catalog/pagination/ListServiceActionsPaginator.ts new file mode 100644 index 0000000000000..72dcfeb45161a --- /dev/null +++ b/clients/client-service-catalog/pagination/ListServiceActionsPaginator.ts @@ -0,0 +1,51 @@ +import { ServiceCatalog } from "../ServiceCatalog"; +import { ServiceCatalogClient } from "../ServiceCatalogClient"; +import { + ListServiceActionsCommand, + ListServiceActionsCommandInput, + ListServiceActionsCommandOutput, +} from "../commands/ListServiceActionsCommand"; +import { ServiceCatalogPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ServiceCatalogClient, + input: ListServiceActionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListServiceActionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ServiceCatalog, + input: ListServiceActionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listServiceActions(input, ...args); +}; +export async function* listServiceActionsPaginate( + config: ServiceCatalogPaginationConfiguration, + input: ListServiceActionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListServiceActionsCommandOutput; + while (hasNext) { + input["PageToken"] = token; + input["PageSize"] = config.pageSize; + if (config.client instanceof ServiceCatalog) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ServiceCatalogClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ServiceCatalog | ServiceCatalogClient"); + } + yield page; + token = page["NextPageToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-service-catalog/pagination/ListTagOptionsPaginator.ts b/clients/client-service-catalog/pagination/ListTagOptionsPaginator.ts new file mode 100644 index 0000000000000..92459139378be --- /dev/null +++ b/clients/client-service-catalog/pagination/ListTagOptionsPaginator.ts @@ -0,0 +1,51 @@ +import { ServiceCatalog } from "../ServiceCatalog"; +import { ServiceCatalogClient } from "../ServiceCatalogClient"; +import { + ListTagOptionsCommand, + ListTagOptionsCommandInput, + ListTagOptionsCommandOutput, +} from "../commands/ListTagOptionsCommand"; +import { ServiceCatalogPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ServiceCatalogClient, + input: ListTagOptionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTagOptionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ServiceCatalog, + input: ListTagOptionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTagOptions(input, ...args); +}; +export async function* listTagOptionsPaginate( + config: ServiceCatalogPaginationConfiguration, + input: ListTagOptionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTagOptionsCommandOutput; + while (hasNext) { + input["PageToken"] = token; + input["PageSize"] = config.pageSize; + if (config.client instanceof ServiceCatalog) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ServiceCatalogClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ServiceCatalog | ServiceCatalogClient"); + } + yield page; + token = page["PageToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-service-catalog/pagination/SearchProductsAsAdminPaginator.ts b/clients/client-service-catalog/pagination/SearchProductsAsAdminPaginator.ts new file mode 100644 index 0000000000000..d729a569fd042 --- /dev/null +++ b/clients/client-service-catalog/pagination/SearchProductsAsAdminPaginator.ts @@ -0,0 +1,51 @@ +import { ServiceCatalog } from "../ServiceCatalog"; +import { ServiceCatalogClient } from "../ServiceCatalogClient"; +import { + SearchProductsAsAdminCommand, + SearchProductsAsAdminCommandInput, + SearchProductsAsAdminCommandOutput, +} from "../commands/SearchProductsAsAdminCommand"; +import { ServiceCatalogPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ServiceCatalogClient, + input: SearchProductsAsAdminCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new SearchProductsAsAdminCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ServiceCatalog, + input: SearchProductsAsAdminCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.searchProductsAsAdmin(input, ...args); +}; +export async function* searchProductsAsAdminPaginate( + config: ServiceCatalogPaginationConfiguration, + input: SearchProductsAsAdminCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: SearchProductsAsAdminCommandOutput; + while (hasNext) { + input["PageToken"] = token; + input["PageSize"] = config.pageSize; + if (config.client instanceof ServiceCatalog) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ServiceCatalogClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ServiceCatalog | ServiceCatalogClient"); + } + yield page; + token = page["NextPageToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-service-catalog/pagination/SearchProductsPaginator.ts b/clients/client-service-catalog/pagination/SearchProductsPaginator.ts new file mode 100644 index 0000000000000..1ab0d75fb4358 --- /dev/null +++ b/clients/client-service-catalog/pagination/SearchProductsPaginator.ts @@ -0,0 +1,51 @@ +import { ServiceCatalog } from "../ServiceCatalog"; +import { ServiceCatalogClient } from "../ServiceCatalogClient"; +import { + SearchProductsCommand, + SearchProductsCommandInput, + SearchProductsCommandOutput, +} from "../commands/SearchProductsCommand"; +import { ServiceCatalogPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ServiceCatalogClient, + input: SearchProductsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new SearchProductsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ServiceCatalog, + input: SearchProductsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.searchProducts(input, ...args); +}; +export async function* searchProductsPaginate( + config: ServiceCatalogPaginationConfiguration, + input: SearchProductsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: SearchProductsCommandOutput; + while (hasNext) { + input["PageToken"] = token; + input["PageSize"] = config.pageSize; + if (config.client instanceof ServiceCatalog) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ServiceCatalogClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ServiceCatalog | ServiceCatalogClient"); + } + yield page; + token = page["NextPageToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-service-catalog/pagination/SearchProvisionedProductsPaginator.ts b/clients/client-service-catalog/pagination/SearchProvisionedProductsPaginator.ts new file mode 100644 index 0000000000000..eafb76e406f89 --- /dev/null +++ b/clients/client-service-catalog/pagination/SearchProvisionedProductsPaginator.ts @@ -0,0 +1,51 @@ +import { ServiceCatalog } from "../ServiceCatalog"; +import { ServiceCatalogClient } from "../ServiceCatalogClient"; +import { + SearchProvisionedProductsCommand, + SearchProvisionedProductsCommandInput, + SearchProvisionedProductsCommandOutput, +} from "../commands/SearchProvisionedProductsCommand"; +import { ServiceCatalogPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ServiceCatalogClient, + input: SearchProvisionedProductsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new SearchProvisionedProductsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ServiceCatalog, + input: SearchProvisionedProductsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.searchProvisionedProducts(input, ...args); +}; +export async function* searchProvisionedProductsPaginate( + config: ServiceCatalogPaginationConfiguration, + input: SearchProvisionedProductsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: SearchProvisionedProductsCommandOutput; + while (hasNext) { + input["PageToken"] = token; + input["PageSize"] = config.pageSize; + if (config.client instanceof ServiceCatalog) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ServiceCatalogClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ServiceCatalog | ServiceCatalogClient"); + } + yield page; + token = page["NextPageToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-service-quotas/index.ts b/clients/client-service-quotas/index.ts index 444bfb5856fd0..9cbb8b0806b89 100644 --- a/clients/client-service-quotas/index.ts +++ b/clients/client-service-quotas/index.ts @@ -9,11 +9,18 @@ export * from "./commands/GetRequestedServiceQuotaChangeCommand"; export * from "./commands/GetServiceQuotaCommand"; export * from "./commands/GetServiceQuotaIncreaseRequestFromTemplateCommand"; export * from "./commands/ListAWSDefaultServiceQuotasCommand"; +export * from "./pagination/ListAWSDefaultServiceQuotasPaginator"; export * from "./commands/ListRequestedServiceQuotaChangeHistoryCommand"; +export * from "./pagination/ListRequestedServiceQuotaChangeHistoryPaginator"; export * from "./commands/ListRequestedServiceQuotaChangeHistoryByQuotaCommand"; +export * from "./pagination/ListRequestedServiceQuotaChangeHistoryByQuotaPaginator"; export * from "./commands/ListServiceQuotaIncreaseRequestsInTemplateCommand"; +export * from "./pagination/ListServiceQuotaIncreaseRequestsInTemplatePaginator"; export * from "./commands/ListServiceQuotasCommand"; +export * from "./pagination/ListServiceQuotasPaginator"; export * from "./commands/ListServicesCommand"; +export * from "./pagination/ListServicesPaginator"; export * from "./commands/PutServiceQuotaIncreaseRequestIntoTemplateCommand"; export * from "./commands/RequestServiceQuotaIncreaseCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-service-quotas/pagination/Interfaces.ts b/clients/client-service-quotas/pagination/Interfaces.ts new file mode 100644 index 0000000000000..1a063587effe8 --- /dev/null +++ b/clients/client-service-quotas/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { ServiceQuotas } from "../ServiceQuotas"; +import { ServiceQuotasClient } from "../ServiceQuotasClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface ServiceQuotasPaginationConfiguration extends PaginationConfiguration { + client: ServiceQuotas | ServiceQuotasClient; +} diff --git a/clients/client-service-quotas/pagination/ListAWSDefaultServiceQuotasPaginator.ts b/clients/client-service-quotas/pagination/ListAWSDefaultServiceQuotasPaginator.ts new file mode 100644 index 0000000000000..17366569e41ed --- /dev/null +++ b/clients/client-service-quotas/pagination/ListAWSDefaultServiceQuotasPaginator.ts @@ -0,0 +1,51 @@ +import { ServiceQuotas } from "../ServiceQuotas"; +import { ServiceQuotasClient } from "../ServiceQuotasClient"; +import { + ListAWSDefaultServiceQuotasCommand, + ListAWSDefaultServiceQuotasCommandInput, + ListAWSDefaultServiceQuotasCommandOutput, +} from "../commands/ListAWSDefaultServiceQuotasCommand"; +import { ServiceQuotasPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ServiceQuotasClient, + input: ListAWSDefaultServiceQuotasCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListAWSDefaultServiceQuotasCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ServiceQuotas, + input: ListAWSDefaultServiceQuotasCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listAWSDefaultServiceQuotas(input, ...args); +}; +export async function* listAWSDefaultServiceQuotasPaginate( + config: ServiceQuotasPaginationConfiguration, + input: ListAWSDefaultServiceQuotasCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListAWSDefaultServiceQuotasCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof ServiceQuotas) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ServiceQuotasClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ServiceQuotas | ServiceQuotasClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-service-quotas/pagination/ListRequestedServiceQuotaChangeHistoryByQuotaPaginator.ts b/clients/client-service-quotas/pagination/ListRequestedServiceQuotaChangeHistoryByQuotaPaginator.ts new file mode 100644 index 0000000000000..e8278f8400809 --- /dev/null +++ b/clients/client-service-quotas/pagination/ListRequestedServiceQuotaChangeHistoryByQuotaPaginator.ts @@ -0,0 +1,51 @@ +import { ServiceQuotas } from "../ServiceQuotas"; +import { ServiceQuotasClient } from "../ServiceQuotasClient"; +import { + ListRequestedServiceQuotaChangeHistoryByQuotaCommand, + ListRequestedServiceQuotaChangeHistoryByQuotaCommandInput, + ListRequestedServiceQuotaChangeHistoryByQuotaCommandOutput, +} from "../commands/ListRequestedServiceQuotaChangeHistoryByQuotaCommand"; +import { ServiceQuotasPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ServiceQuotasClient, + input: ListRequestedServiceQuotaChangeHistoryByQuotaCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListRequestedServiceQuotaChangeHistoryByQuotaCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ServiceQuotas, + input: ListRequestedServiceQuotaChangeHistoryByQuotaCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listRequestedServiceQuotaChangeHistoryByQuota(input, ...args); +}; +export async function* listRequestedServiceQuotaChangeHistoryByQuotaPaginate( + config: ServiceQuotasPaginationConfiguration, + input: ListRequestedServiceQuotaChangeHistoryByQuotaCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListRequestedServiceQuotaChangeHistoryByQuotaCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof ServiceQuotas) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ServiceQuotasClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ServiceQuotas | ServiceQuotasClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-service-quotas/pagination/ListRequestedServiceQuotaChangeHistoryPaginator.ts b/clients/client-service-quotas/pagination/ListRequestedServiceQuotaChangeHistoryPaginator.ts new file mode 100644 index 0000000000000..3c6d219627a9c --- /dev/null +++ b/clients/client-service-quotas/pagination/ListRequestedServiceQuotaChangeHistoryPaginator.ts @@ -0,0 +1,51 @@ +import { ServiceQuotas } from "../ServiceQuotas"; +import { ServiceQuotasClient } from "../ServiceQuotasClient"; +import { + ListRequestedServiceQuotaChangeHistoryCommand, + ListRequestedServiceQuotaChangeHistoryCommandInput, + ListRequestedServiceQuotaChangeHistoryCommandOutput, +} from "../commands/ListRequestedServiceQuotaChangeHistoryCommand"; +import { ServiceQuotasPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ServiceQuotasClient, + input: ListRequestedServiceQuotaChangeHistoryCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListRequestedServiceQuotaChangeHistoryCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ServiceQuotas, + input: ListRequestedServiceQuotaChangeHistoryCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listRequestedServiceQuotaChangeHistory(input, ...args); +}; +export async function* listRequestedServiceQuotaChangeHistoryPaginate( + config: ServiceQuotasPaginationConfiguration, + input: ListRequestedServiceQuotaChangeHistoryCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListRequestedServiceQuotaChangeHistoryCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof ServiceQuotas) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ServiceQuotasClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ServiceQuotas | ServiceQuotasClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-service-quotas/pagination/ListServiceQuotaIncreaseRequestsInTemplatePaginator.ts b/clients/client-service-quotas/pagination/ListServiceQuotaIncreaseRequestsInTemplatePaginator.ts new file mode 100644 index 0000000000000..e89648d831115 --- /dev/null +++ b/clients/client-service-quotas/pagination/ListServiceQuotaIncreaseRequestsInTemplatePaginator.ts @@ -0,0 +1,51 @@ +import { ServiceQuotas } from "../ServiceQuotas"; +import { ServiceQuotasClient } from "../ServiceQuotasClient"; +import { + ListServiceQuotaIncreaseRequestsInTemplateCommand, + ListServiceQuotaIncreaseRequestsInTemplateCommandInput, + ListServiceQuotaIncreaseRequestsInTemplateCommandOutput, +} from "../commands/ListServiceQuotaIncreaseRequestsInTemplateCommand"; +import { ServiceQuotasPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ServiceQuotasClient, + input: ListServiceQuotaIncreaseRequestsInTemplateCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListServiceQuotaIncreaseRequestsInTemplateCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ServiceQuotas, + input: ListServiceQuotaIncreaseRequestsInTemplateCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listServiceQuotaIncreaseRequestsInTemplate(input, ...args); +}; +export async function* listServiceQuotaIncreaseRequestsInTemplatePaginate( + config: ServiceQuotasPaginationConfiguration, + input: ListServiceQuotaIncreaseRequestsInTemplateCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListServiceQuotaIncreaseRequestsInTemplateCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof ServiceQuotas) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ServiceQuotasClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ServiceQuotas | ServiceQuotasClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-service-quotas/pagination/ListServiceQuotasPaginator.ts b/clients/client-service-quotas/pagination/ListServiceQuotasPaginator.ts new file mode 100644 index 0000000000000..a231a4cc70f09 --- /dev/null +++ b/clients/client-service-quotas/pagination/ListServiceQuotasPaginator.ts @@ -0,0 +1,51 @@ +import { ServiceQuotas } from "../ServiceQuotas"; +import { ServiceQuotasClient } from "../ServiceQuotasClient"; +import { + ListServiceQuotasCommand, + ListServiceQuotasCommandInput, + ListServiceQuotasCommandOutput, +} from "../commands/ListServiceQuotasCommand"; +import { ServiceQuotasPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ServiceQuotasClient, + input: ListServiceQuotasCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListServiceQuotasCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ServiceQuotas, + input: ListServiceQuotasCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listServiceQuotas(input, ...args); +}; +export async function* listServiceQuotasPaginate( + config: ServiceQuotasPaginationConfiguration, + input: ListServiceQuotasCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListServiceQuotasCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof ServiceQuotas) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ServiceQuotasClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ServiceQuotas | ServiceQuotasClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-service-quotas/pagination/ListServicesPaginator.ts b/clients/client-service-quotas/pagination/ListServicesPaginator.ts new file mode 100644 index 0000000000000..7c1008fb971d4 --- /dev/null +++ b/clients/client-service-quotas/pagination/ListServicesPaginator.ts @@ -0,0 +1,51 @@ +import { ServiceQuotas } from "../ServiceQuotas"; +import { ServiceQuotasClient } from "../ServiceQuotasClient"; +import { + ListServicesCommand, + ListServicesCommandInput, + ListServicesCommandOutput, +} from "../commands/ListServicesCommand"; +import { ServiceQuotasPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ServiceQuotasClient, + input: ListServicesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListServicesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ServiceQuotas, + input: ListServicesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listServices(input, ...args); +}; +export async function* listServicesPaginate( + config: ServiceQuotasPaginationConfiguration, + input: ListServicesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListServicesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof ServiceQuotas) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ServiceQuotasClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ServiceQuotas | ServiceQuotasClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-servicediscovery/index.ts b/clients/client-servicediscovery/index.ts index f13e8e2fb508c..49a246cd5520a 100644 --- a/clients/client-servicediscovery/index.ts +++ b/clients/client-servicediscovery/index.ts @@ -10,17 +10,23 @@ export * from "./commands/DeregisterInstanceCommand"; export * from "./commands/DiscoverInstancesCommand"; export * from "./commands/GetInstanceCommand"; export * from "./commands/GetInstancesHealthStatusCommand"; +export * from "./pagination/GetInstancesHealthStatusPaginator"; export * from "./commands/GetNamespaceCommand"; export * from "./commands/GetOperationCommand"; export * from "./commands/GetServiceCommand"; export * from "./commands/ListInstancesCommand"; +export * from "./pagination/ListInstancesPaginator"; export * from "./commands/ListNamespacesCommand"; +export * from "./pagination/ListNamespacesPaginator"; export * from "./commands/ListOperationsCommand"; +export * from "./pagination/ListOperationsPaginator"; export * from "./commands/ListServicesCommand"; +export * from "./pagination/ListServicesPaginator"; export * from "./commands/ListTagsForResourceCommand"; export * from "./commands/RegisterInstanceCommand"; export * from "./commands/TagResourceCommand"; export * from "./commands/UntagResourceCommand"; export * from "./commands/UpdateInstanceCustomHealthStatusCommand"; export * from "./commands/UpdateServiceCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-servicediscovery/pagination/GetInstancesHealthStatusPaginator.ts b/clients/client-servicediscovery/pagination/GetInstancesHealthStatusPaginator.ts new file mode 100644 index 0000000000000..939c35e2a5bd1 --- /dev/null +++ b/clients/client-servicediscovery/pagination/GetInstancesHealthStatusPaginator.ts @@ -0,0 +1,51 @@ +import { ServiceDiscovery } from "../ServiceDiscovery"; +import { ServiceDiscoveryClient } from "../ServiceDiscoveryClient"; +import { + GetInstancesHealthStatusCommand, + GetInstancesHealthStatusCommandInput, + GetInstancesHealthStatusCommandOutput, +} from "../commands/GetInstancesHealthStatusCommand"; +import { ServiceDiscoveryPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ServiceDiscoveryClient, + input: GetInstancesHealthStatusCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetInstancesHealthStatusCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ServiceDiscovery, + input: GetInstancesHealthStatusCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getInstancesHealthStatus(input, ...args); +}; +export async function* getInstancesHealthStatusPaginate( + config: ServiceDiscoveryPaginationConfiguration, + input: GetInstancesHealthStatusCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetInstancesHealthStatusCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof ServiceDiscovery) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ServiceDiscoveryClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ServiceDiscovery | ServiceDiscoveryClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-servicediscovery/pagination/Interfaces.ts b/clients/client-servicediscovery/pagination/Interfaces.ts new file mode 100644 index 0000000000000..2d0e74dcda4f5 --- /dev/null +++ b/clients/client-servicediscovery/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { ServiceDiscovery } from "../ServiceDiscovery"; +import { ServiceDiscoveryClient } from "../ServiceDiscoveryClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface ServiceDiscoveryPaginationConfiguration extends PaginationConfiguration { + client: ServiceDiscovery | ServiceDiscoveryClient; +} diff --git a/clients/client-servicediscovery/pagination/ListInstancesPaginator.ts b/clients/client-servicediscovery/pagination/ListInstancesPaginator.ts new file mode 100644 index 0000000000000..d65beeff23cdf --- /dev/null +++ b/clients/client-servicediscovery/pagination/ListInstancesPaginator.ts @@ -0,0 +1,51 @@ +import { ServiceDiscovery } from "../ServiceDiscovery"; +import { ServiceDiscoveryClient } from "../ServiceDiscoveryClient"; +import { + ListInstancesCommand, + ListInstancesCommandInput, + ListInstancesCommandOutput, +} from "../commands/ListInstancesCommand"; +import { ServiceDiscoveryPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ServiceDiscoveryClient, + input: ListInstancesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListInstancesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ServiceDiscovery, + input: ListInstancesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listInstances(input, ...args); +}; +export async function* listInstancesPaginate( + config: ServiceDiscoveryPaginationConfiguration, + input: ListInstancesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListInstancesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof ServiceDiscovery) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ServiceDiscoveryClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ServiceDiscovery | ServiceDiscoveryClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-servicediscovery/pagination/ListNamespacesPaginator.ts b/clients/client-servicediscovery/pagination/ListNamespacesPaginator.ts new file mode 100644 index 0000000000000..e447736fa42ac --- /dev/null +++ b/clients/client-servicediscovery/pagination/ListNamespacesPaginator.ts @@ -0,0 +1,51 @@ +import { ServiceDiscovery } from "../ServiceDiscovery"; +import { ServiceDiscoveryClient } from "../ServiceDiscoveryClient"; +import { + ListNamespacesCommand, + ListNamespacesCommandInput, + ListNamespacesCommandOutput, +} from "../commands/ListNamespacesCommand"; +import { ServiceDiscoveryPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ServiceDiscoveryClient, + input: ListNamespacesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListNamespacesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ServiceDiscovery, + input: ListNamespacesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listNamespaces(input, ...args); +}; +export async function* listNamespacesPaginate( + config: ServiceDiscoveryPaginationConfiguration, + input: ListNamespacesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListNamespacesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof ServiceDiscovery) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ServiceDiscoveryClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ServiceDiscovery | ServiceDiscoveryClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-servicediscovery/pagination/ListOperationsPaginator.ts b/clients/client-servicediscovery/pagination/ListOperationsPaginator.ts new file mode 100644 index 0000000000000..52806b2ef58bd --- /dev/null +++ b/clients/client-servicediscovery/pagination/ListOperationsPaginator.ts @@ -0,0 +1,51 @@ +import { ServiceDiscovery } from "../ServiceDiscovery"; +import { ServiceDiscoveryClient } from "../ServiceDiscoveryClient"; +import { + ListOperationsCommand, + ListOperationsCommandInput, + ListOperationsCommandOutput, +} from "../commands/ListOperationsCommand"; +import { ServiceDiscoveryPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ServiceDiscoveryClient, + input: ListOperationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListOperationsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ServiceDiscovery, + input: ListOperationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listOperations(input, ...args); +}; +export async function* listOperationsPaginate( + config: ServiceDiscoveryPaginationConfiguration, + input: ListOperationsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListOperationsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof ServiceDiscovery) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ServiceDiscoveryClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ServiceDiscovery | ServiceDiscoveryClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-servicediscovery/pagination/ListServicesPaginator.ts b/clients/client-servicediscovery/pagination/ListServicesPaginator.ts new file mode 100644 index 0000000000000..7ed4037c34f3c --- /dev/null +++ b/clients/client-servicediscovery/pagination/ListServicesPaginator.ts @@ -0,0 +1,51 @@ +import { ServiceDiscovery } from "../ServiceDiscovery"; +import { ServiceDiscoveryClient } from "../ServiceDiscoveryClient"; +import { + ListServicesCommand, + ListServicesCommandInput, + ListServicesCommandOutput, +} from "../commands/ListServicesCommand"; +import { ServiceDiscoveryPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ServiceDiscoveryClient, + input: ListServicesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListServicesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: ServiceDiscovery, + input: ListServicesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listServices(input, ...args); +}; +export async function* listServicesPaginate( + config: ServiceDiscoveryPaginationConfiguration, + input: ListServicesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListServicesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof ServiceDiscovery) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ServiceDiscoveryClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected ServiceDiscovery | ServiceDiscoveryClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-ses/index.ts b/clients/client-ses/index.ts index 206744e96d332..efe678f6dd0fd 100644 --- a/clients/client-ses/index.ts +++ b/clients/client-ses/index.ts @@ -36,7 +36,9 @@ export * from "./commands/GetSendStatisticsCommand"; export * from "./commands/GetTemplateCommand"; export * from "./commands/ListConfigurationSetsCommand"; export * from "./commands/ListCustomVerificationEmailTemplatesCommand"; +export * from "./pagination/ListCustomVerificationEmailTemplatesPaginator"; export * from "./commands/ListIdentitiesCommand"; +export * from "./pagination/ListIdentitiesPaginator"; export * from "./commands/ListIdentityPoliciesCommand"; export * from "./commands/ListReceiptFiltersCommand"; export * from "./commands/ListReceiptRuleSetsCommand"; @@ -71,4 +73,5 @@ export * from "./commands/VerifyDomainDkimCommand"; export * from "./commands/VerifyDomainIdentityCommand"; export * from "./commands/VerifyEmailAddressCommand"; export * from "./commands/VerifyEmailIdentityCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-ses/pagination/Interfaces.ts b/clients/client-ses/pagination/Interfaces.ts new file mode 100644 index 0000000000000..2d4be476e9736 --- /dev/null +++ b/clients/client-ses/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { SES } from "../SES"; +import { SESClient } from "../SESClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface SESPaginationConfiguration extends PaginationConfiguration { + client: SES | SESClient; +} diff --git a/clients/client-ses/pagination/ListCustomVerificationEmailTemplatesPaginator.ts b/clients/client-ses/pagination/ListCustomVerificationEmailTemplatesPaginator.ts new file mode 100644 index 0000000000000..ee6a4030efef6 --- /dev/null +++ b/clients/client-ses/pagination/ListCustomVerificationEmailTemplatesPaginator.ts @@ -0,0 +1,51 @@ +import { SES } from "../SES"; +import { SESClient } from "../SESClient"; +import { + ListCustomVerificationEmailTemplatesCommand, + ListCustomVerificationEmailTemplatesCommandInput, + ListCustomVerificationEmailTemplatesCommandOutput, +} from "../commands/ListCustomVerificationEmailTemplatesCommand"; +import { SESPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SESClient, + input: ListCustomVerificationEmailTemplatesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListCustomVerificationEmailTemplatesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SES, + input: ListCustomVerificationEmailTemplatesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listCustomVerificationEmailTemplates(input, ...args); +}; +export async function* listCustomVerificationEmailTemplatesPaginate( + config: SESPaginationConfiguration, + input: ListCustomVerificationEmailTemplatesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListCustomVerificationEmailTemplatesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SES) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SESClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SES | SESClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-ses/pagination/ListIdentitiesPaginator.ts b/clients/client-ses/pagination/ListIdentitiesPaginator.ts new file mode 100644 index 0000000000000..18f2ca005052f --- /dev/null +++ b/clients/client-ses/pagination/ListIdentitiesPaginator.ts @@ -0,0 +1,51 @@ +import { SES } from "../SES"; +import { SESClient } from "../SESClient"; +import { + ListIdentitiesCommand, + ListIdentitiesCommandInput, + ListIdentitiesCommandOutput, +} from "../commands/ListIdentitiesCommand"; +import { SESPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SESClient, + input: ListIdentitiesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListIdentitiesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SES, + input: ListIdentitiesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listIdentities(input, ...args); +}; +export async function* listIdentitiesPaginate( + config: SESPaginationConfiguration, + input: ListIdentitiesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListIdentitiesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxItems"] = config.pageSize; + if (config.client instanceof SES) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SESClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SES | SESClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sesv2/index.ts b/clients/client-sesv2/index.ts index c6562209dfa41..5ea04878bb91e 100644 --- a/clients/client-sesv2/index.ts +++ b/clients/client-sesv2/index.ts @@ -23,6 +23,7 @@ export * from "./commands/GetConfigurationSetEventDestinationsCommand"; export * from "./commands/GetCustomVerificationEmailTemplateCommand"; export * from "./commands/GetDedicatedIpCommand"; export * from "./commands/GetDedicatedIpsCommand"; +export * from "./pagination/GetDedicatedIpsPaginator"; export * from "./commands/GetDeliverabilityDashboardOptionsCommand"; export * from "./commands/GetDeliverabilityTestReportCommand"; export * from "./commands/GetDomainDeliverabilityCampaignCommand"; @@ -32,13 +33,21 @@ export * from "./commands/GetEmailIdentityPoliciesCommand"; export * from "./commands/GetEmailTemplateCommand"; export * from "./commands/GetSuppressedDestinationCommand"; export * from "./commands/ListConfigurationSetsCommand"; +export * from "./pagination/ListConfigurationSetsPaginator"; export * from "./commands/ListCustomVerificationEmailTemplatesCommand"; +export * from "./pagination/ListCustomVerificationEmailTemplatesPaginator"; export * from "./commands/ListDedicatedIpPoolsCommand"; +export * from "./pagination/ListDedicatedIpPoolsPaginator"; export * from "./commands/ListDeliverabilityTestReportsCommand"; +export * from "./pagination/ListDeliverabilityTestReportsPaginator"; export * from "./commands/ListDomainDeliverabilityCampaignsCommand"; +export * from "./pagination/ListDomainDeliverabilityCampaignsPaginator"; export * from "./commands/ListEmailIdentitiesCommand"; +export * from "./pagination/ListEmailIdentitiesPaginator"; export * from "./commands/ListEmailTemplatesCommand"; +export * from "./pagination/ListEmailTemplatesPaginator"; export * from "./commands/ListSuppressedDestinationsCommand"; +export * from "./pagination/ListSuppressedDestinationsPaginator"; export * from "./commands/ListTagsForResourceCommand"; export * from "./commands/PutAccountDedicatedIpWarmupAttributesCommand"; export * from "./commands/PutAccountDetailsCommand"; @@ -67,4 +76,5 @@ export * from "./commands/UpdateConfigurationSetEventDestinationCommand"; export * from "./commands/UpdateCustomVerificationEmailTemplateCommand"; export * from "./commands/UpdateEmailIdentityPolicyCommand"; export * from "./commands/UpdateEmailTemplateCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-sesv2/pagination/GetDedicatedIpsPaginator.ts b/clients/client-sesv2/pagination/GetDedicatedIpsPaginator.ts new file mode 100644 index 0000000000000..f9875731d5dec --- /dev/null +++ b/clients/client-sesv2/pagination/GetDedicatedIpsPaginator.ts @@ -0,0 +1,51 @@ +import { SESv2 } from "../SESv2"; +import { SESv2Client } from "../SESv2Client"; +import { + GetDedicatedIpsCommand, + GetDedicatedIpsCommandInput, + GetDedicatedIpsCommandOutput, +} from "../commands/GetDedicatedIpsCommand"; +import { SESv2PaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SESv2Client, + input: GetDedicatedIpsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetDedicatedIpsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SESv2, + input: GetDedicatedIpsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getDedicatedIps(input, ...args); +}; +export async function* getDedicatedIpsPaginate( + config: SESv2PaginationConfiguration, + input: GetDedicatedIpsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetDedicatedIpsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["PageSize"] = config.pageSize; + if (config.client instanceof SESv2) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SESv2Client) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SESv2 | SESv2Client"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sesv2/pagination/Interfaces.ts b/clients/client-sesv2/pagination/Interfaces.ts new file mode 100644 index 0000000000000..d66fb5cd9cc66 --- /dev/null +++ b/clients/client-sesv2/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { SESv2 } from "../SESv2"; +import { SESv2Client } from "../SESv2Client"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface SESv2PaginationConfiguration extends PaginationConfiguration { + client: SESv2 | SESv2Client; +} diff --git a/clients/client-sesv2/pagination/ListConfigurationSetsPaginator.ts b/clients/client-sesv2/pagination/ListConfigurationSetsPaginator.ts new file mode 100644 index 0000000000000..cf9ebd11aec32 --- /dev/null +++ b/clients/client-sesv2/pagination/ListConfigurationSetsPaginator.ts @@ -0,0 +1,51 @@ +import { SESv2 } from "../SESv2"; +import { SESv2Client } from "../SESv2Client"; +import { + ListConfigurationSetsCommand, + ListConfigurationSetsCommandInput, + ListConfigurationSetsCommandOutput, +} from "../commands/ListConfigurationSetsCommand"; +import { SESv2PaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SESv2Client, + input: ListConfigurationSetsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListConfigurationSetsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SESv2, + input: ListConfigurationSetsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listConfigurationSets(input, ...args); +}; +export async function* listConfigurationSetsPaginate( + config: SESv2PaginationConfiguration, + input: ListConfigurationSetsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListConfigurationSetsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["PageSize"] = config.pageSize; + if (config.client instanceof SESv2) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SESv2Client) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SESv2 | SESv2Client"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sesv2/pagination/ListCustomVerificationEmailTemplatesPaginator.ts b/clients/client-sesv2/pagination/ListCustomVerificationEmailTemplatesPaginator.ts new file mode 100644 index 0000000000000..be087872c36c4 --- /dev/null +++ b/clients/client-sesv2/pagination/ListCustomVerificationEmailTemplatesPaginator.ts @@ -0,0 +1,51 @@ +import { SESv2 } from "../SESv2"; +import { SESv2Client } from "../SESv2Client"; +import { + ListCustomVerificationEmailTemplatesCommand, + ListCustomVerificationEmailTemplatesCommandInput, + ListCustomVerificationEmailTemplatesCommandOutput, +} from "../commands/ListCustomVerificationEmailTemplatesCommand"; +import { SESv2PaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SESv2Client, + input: ListCustomVerificationEmailTemplatesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListCustomVerificationEmailTemplatesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SESv2, + input: ListCustomVerificationEmailTemplatesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listCustomVerificationEmailTemplates(input, ...args); +}; +export async function* listCustomVerificationEmailTemplatesPaginate( + config: SESv2PaginationConfiguration, + input: ListCustomVerificationEmailTemplatesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListCustomVerificationEmailTemplatesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["PageSize"] = config.pageSize; + if (config.client instanceof SESv2) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SESv2Client) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SESv2 | SESv2Client"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sesv2/pagination/ListDedicatedIpPoolsPaginator.ts b/clients/client-sesv2/pagination/ListDedicatedIpPoolsPaginator.ts new file mode 100644 index 0000000000000..a2c5706deebcc --- /dev/null +++ b/clients/client-sesv2/pagination/ListDedicatedIpPoolsPaginator.ts @@ -0,0 +1,51 @@ +import { SESv2 } from "../SESv2"; +import { SESv2Client } from "../SESv2Client"; +import { + ListDedicatedIpPoolsCommand, + ListDedicatedIpPoolsCommandInput, + ListDedicatedIpPoolsCommandOutput, +} from "../commands/ListDedicatedIpPoolsCommand"; +import { SESv2PaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SESv2Client, + input: ListDedicatedIpPoolsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDedicatedIpPoolsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SESv2, + input: ListDedicatedIpPoolsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDedicatedIpPools(input, ...args); +}; +export async function* listDedicatedIpPoolsPaginate( + config: SESv2PaginationConfiguration, + input: ListDedicatedIpPoolsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDedicatedIpPoolsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["PageSize"] = config.pageSize; + if (config.client instanceof SESv2) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SESv2Client) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SESv2 | SESv2Client"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sesv2/pagination/ListDeliverabilityTestReportsPaginator.ts b/clients/client-sesv2/pagination/ListDeliverabilityTestReportsPaginator.ts new file mode 100644 index 0000000000000..265e777ccec6a --- /dev/null +++ b/clients/client-sesv2/pagination/ListDeliverabilityTestReportsPaginator.ts @@ -0,0 +1,51 @@ +import { SESv2 } from "../SESv2"; +import { SESv2Client } from "../SESv2Client"; +import { + ListDeliverabilityTestReportsCommand, + ListDeliverabilityTestReportsCommandInput, + ListDeliverabilityTestReportsCommandOutput, +} from "../commands/ListDeliverabilityTestReportsCommand"; +import { SESv2PaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SESv2Client, + input: ListDeliverabilityTestReportsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDeliverabilityTestReportsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SESv2, + input: ListDeliverabilityTestReportsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDeliverabilityTestReports(input, ...args); +}; +export async function* listDeliverabilityTestReportsPaginate( + config: SESv2PaginationConfiguration, + input: ListDeliverabilityTestReportsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDeliverabilityTestReportsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["PageSize"] = config.pageSize; + if (config.client instanceof SESv2) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SESv2Client) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SESv2 | SESv2Client"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sesv2/pagination/ListDomainDeliverabilityCampaignsPaginator.ts b/clients/client-sesv2/pagination/ListDomainDeliverabilityCampaignsPaginator.ts new file mode 100644 index 0000000000000..d038faf374048 --- /dev/null +++ b/clients/client-sesv2/pagination/ListDomainDeliverabilityCampaignsPaginator.ts @@ -0,0 +1,51 @@ +import { SESv2 } from "../SESv2"; +import { SESv2Client } from "../SESv2Client"; +import { + ListDomainDeliverabilityCampaignsCommand, + ListDomainDeliverabilityCampaignsCommandInput, + ListDomainDeliverabilityCampaignsCommandOutput, +} from "../commands/ListDomainDeliverabilityCampaignsCommand"; +import { SESv2PaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SESv2Client, + input: ListDomainDeliverabilityCampaignsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDomainDeliverabilityCampaignsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SESv2, + input: ListDomainDeliverabilityCampaignsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDomainDeliverabilityCampaigns(input, ...args); +}; +export async function* listDomainDeliverabilityCampaignsPaginate( + config: SESv2PaginationConfiguration, + input: ListDomainDeliverabilityCampaignsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDomainDeliverabilityCampaignsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["PageSize"] = config.pageSize; + if (config.client instanceof SESv2) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SESv2Client) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SESv2 | SESv2Client"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sesv2/pagination/ListEmailIdentitiesPaginator.ts b/clients/client-sesv2/pagination/ListEmailIdentitiesPaginator.ts new file mode 100644 index 0000000000000..0c156b7d3270e --- /dev/null +++ b/clients/client-sesv2/pagination/ListEmailIdentitiesPaginator.ts @@ -0,0 +1,51 @@ +import { SESv2 } from "../SESv2"; +import { SESv2Client } from "../SESv2Client"; +import { + ListEmailIdentitiesCommand, + ListEmailIdentitiesCommandInput, + ListEmailIdentitiesCommandOutput, +} from "../commands/ListEmailIdentitiesCommand"; +import { SESv2PaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SESv2Client, + input: ListEmailIdentitiesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListEmailIdentitiesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SESv2, + input: ListEmailIdentitiesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listEmailIdentities(input, ...args); +}; +export async function* listEmailIdentitiesPaginate( + config: SESv2PaginationConfiguration, + input: ListEmailIdentitiesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListEmailIdentitiesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["PageSize"] = config.pageSize; + if (config.client instanceof SESv2) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SESv2Client) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SESv2 | SESv2Client"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sesv2/pagination/ListEmailTemplatesPaginator.ts b/clients/client-sesv2/pagination/ListEmailTemplatesPaginator.ts new file mode 100644 index 0000000000000..77e9fe6adc436 --- /dev/null +++ b/clients/client-sesv2/pagination/ListEmailTemplatesPaginator.ts @@ -0,0 +1,51 @@ +import { SESv2 } from "../SESv2"; +import { SESv2Client } from "../SESv2Client"; +import { + ListEmailTemplatesCommand, + ListEmailTemplatesCommandInput, + ListEmailTemplatesCommandOutput, +} from "../commands/ListEmailTemplatesCommand"; +import { SESv2PaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SESv2Client, + input: ListEmailTemplatesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListEmailTemplatesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SESv2, + input: ListEmailTemplatesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listEmailTemplates(input, ...args); +}; +export async function* listEmailTemplatesPaginate( + config: SESv2PaginationConfiguration, + input: ListEmailTemplatesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListEmailTemplatesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["PageSize"] = config.pageSize; + if (config.client instanceof SESv2) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SESv2Client) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SESv2 | SESv2Client"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sesv2/pagination/ListSuppressedDestinationsPaginator.ts b/clients/client-sesv2/pagination/ListSuppressedDestinationsPaginator.ts new file mode 100644 index 0000000000000..56beb87fb2160 --- /dev/null +++ b/clients/client-sesv2/pagination/ListSuppressedDestinationsPaginator.ts @@ -0,0 +1,51 @@ +import { SESv2 } from "../SESv2"; +import { SESv2Client } from "../SESv2Client"; +import { + ListSuppressedDestinationsCommand, + ListSuppressedDestinationsCommandInput, + ListSuppressedDestinationsCommandOutput, +} from "../commands/ListSuppressedDestinationsCommand"; +import { SESv2PaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SESv2Client, + input: ListSuppressedDestinationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListSuppressedDestinationsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SESv2, + input: ListSuppressedDestinationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listSuppressedDestinations(input, ...args); +}; +export async function* listSuppressedDestinationsPaginate( + config: SESv2PaginationConfiguration, + input: ListSuppressedDestinationsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListSuppressedDestinationsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["PageSize"] = config.pageSize; + if (config.client instanceof SESv2) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SESv2Client) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SESv2 | SESv2Client"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sfn/index.ts b/clients/client-sfn/index.ts index 575b5b35a04a0..745a9fdd223b0 100644 --- a/clients/client-sfn/index.ts +++ b/clients/client-sfn/index.ts @@ -10,9 +10,13 @@ export * from "./commands/DescribeStateMachineCommand"; export * from "./commands/DescribeStateMachineForExecutionCommand"; export * from "./commands/GetActivityTaskCommand"; export * from "./commands/GetExecutionHistoryCommand"; +export * from "./pagination/GetExecutionHistoryPaginator"; export * from "./commands/ListActivitiesCommand"; +export * from "./pagination/ListActivitiesPaginator"; export * from "./commands/ListExecutionsCommand"; +export * from "./pagination/ListExecutionsPaginator"; export * from "./commands/ListStateMachinesCommand"; +export * from "./pagination/ListStateMachinesPaginator"; export * from "./commands/ListTagsForResourceCommand"; export * from "./commands/SendTaskFailureCommand"; export * from "./commands/SendTaskHeartbeatCommand"; @@ -22,4 +26,5 @@ export * from "./commands/StopExecutionCommand"; export * from "./commands/TagResourceCommand"; export * from "./commands/UntagResourceCommand"; export * from "./commands/UpdateStateMachineCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-sfn/pagination/GetExecutionHistoryPaginator.ts b/clients/client-sfn/pagination/GetExecutionHistoryPaginator.ts new file mode 100644 index 0000000000000..202277f3485e2 --- /dev/null +++ b/clients/client-sfn/pagination/GetExecutionHistoryPaginator.ts @@ -0,0 +1,51 @@ +import { SFN } from "../SFN"; +import { SFNClient } from "../SFNClient"; +import { + GetExecutionHistoryCommand, + GetExecutionHistoryCommandInput, + GetExecutionHistoryCommandOutput, +} from "../commands/GetExecutionHistoryCommand"; +import { SFNPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SFNClient, + input: GetExecutionHistoryCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetExecutionHistoryCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SFN, + input: GetExecutionHistoryCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getExecutionHistory(input, ...args); +}; +export async function* getExecutionHistoryPaginate( + config: SFNPaginationConfiguration, + input: GetExecutionHistoryCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetExecutionHistoryCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof SFN) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SFNClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SFN | SFNClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sfn/pagination/Interfaces.ts b/clients/client-sfn/pagination/Interfaces.ts new file mode 100644 index 0000000000000..1efcefb38ebff --- /dev/null +++ b/clients/client-sfn/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { SFN } from "../SFN"; +import { SFNClient } from "../SFNClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface SFNPaginationConfiguration extends PaginationConfiguration { + client: SFN | SFNClient; +} diff --git a/clients/client-sfn/pagination/ListActivitiesPaginator.ts b/clients/client-sfn/pagination/ListActivitiesPaginator.ts new file mode 100644 index 0000000000000..bd6f2a613496a --- /dev/null +++ b/clients/client-sfn/pagination/ListActivitiesPaginator.ts @@ -0,0 +1,51 @@ +import { SFN } from "../SFN"; +import { SFNClient } from "../SFNClient"; +import { + ListActivitiesCommand, + ListActivitiesCommandInput, + ListActivitiesCommandOutput, +} from "../commands/ListActivitiesCommand"; +import { SFNPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SFNClient, + input: ListActivitiesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListActivitiesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SFN, + input: ListActivitiesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listActivities(input, ...args); +}; +export async function* listActivitiesPaginate( + config: SFNPaginationConfiguration, + input: ListActivitiesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListActivitiesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof SFN) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SFNClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SFN | SFNClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sfn/pagination/ListExecutionsPaginator.ts b/clients/client-sfn/pagination/ListExecutionsPaginator.ts new file mode 100644 index 0000000000000..6445bb5038b43 --- /dev/null +++ b/clients/client-sfn/pagination/ListExecutionsPaginator.ts @@ -0,0 +1,51 @@ +import { SFN } from "../SFN"; +import { SFNClient } from "../SFNClient"; +import { + ListExecutionsCommand, + ListExecutionsCommandInput, + ListExecutionsCommandOutput, +} from "../commands/ListExecutionsCommand"; +import { SFNPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SFNClient, + input: ListExecutionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListExecutionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SFN, + input: ListExecutionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listExecutions(input, ...args); +}; +export async function* listExecutionsPaginate( + config: SFNPaginationConfiguration, + input: ListExecutionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListExecutionsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof SFN) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SFNClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SFN | SFNClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sfn/pagination/ListStateMachinesPaginator.ts b/clients/client-sfn/pagination/ListStateMachinesPaginator.ts new file mode 100644 index 0000000000000..dc242c2fae70e --- /dev/null +++ b/clients/client-sfn/pagination/ListStateMachinesPaginator.ts @@ -0,0 +1,51 @@ +import { SFN } from "../SFN"; +import { SFNClient } from "../SFNClient"; +import { + ListStateMachinesCommand, + ListStateMachinesCommandInput, + ListStateMachinesCommandOutput, +} from "../commands/ListStateMachinesCommand"; +import { SFNPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SFNClient, + input: ListStateMachinesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListStateMachinesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SFN, + input: ListStateMachinesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listStateMachines(input, ...args); +}; +export async function* listStateMachinesPaginate( + config: SFNPaginationConfiguration, + input: ListStateMachinesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListStateMachinesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof SFN) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SFNClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SFN | SFNClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-shield/index.ts b/clients/client-shield/index.ts index 689a9bb05715b..5fee981be847c 100644 --- a/clients/client-shield/index.ts +++ b/clients/client-shield/index.ts @@ -20,7 +20,10 @@ export * from "./commands/DisassociateHealthCheckCommand"; export * from "./commands/EnableProactiveEngagementCommand"; export * from "./commands/GetSubscriptionStateCommand"; export * from "./commands/ListAttacksCommand"; +export * from "./pagination/ListAttacksPaginator"; export * from "./commands/ListProtectionsCommand"; +export * from "./pagination/ListProtectionsPaginator"; export * from "./commands/UpdateEmergencyContactSettingsCommand"; export * from "./commands/UpdateSubscriptionCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-shield/pagination/Interfaces.ts b/clients/client-shield/pagination/Interfaces.ts new file mode 100644 index 0000000000000..718c4d385a59f --- /dev/null +++ b/clients/client-shield/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { Shield } from "../Shield"; +import { ShieldClient } from "../ShieldClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface ShieldPaginationConfiguration extends PaginationConfiguration { + client: Shield | ShieldClient; +} diff --git a/clients/client-shield/pagination/ListAttacksPaginator.ts b/clients/client-shield/pagination/ListAttacksPaginator.ts new file mode 100644 index 0000000000000..8c6088435bb42 --- /dev/null +++ b/clients/client-shield/pagination/ListAttacksPaginator.ts @@ -0,0 +1,47 @@ +import { Shield } from "../Shield"; +import { ShieldClient } from "../ShieldClient"; +import { ListAttacksCommand, ListAttacksCommandInput, ListAttacksCommandOutput } from "../commands/ListAttacksCommand"; +import { ShieldPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ShieldClient, + input: ListAttacksCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListAttacksCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Shield, + input: ListAttacksCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listAttacks(input, ...args); +}; +export async function* listAttacksPaginate( + config: ShieldPaginationConfiguration, + input: ListAttacksCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListAttacksCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Shield) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ShieldClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Shield | ShieldClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-shield/pagination/ListProtectionsPaginator.ts b/clients/client-shield/pagination/ListProtectionsPaginator.ts new file mode 100644 index 0000000000000..0bc1588b92eae --- /dev/null +++ b/clients/client-shield/pagination/ListProtectionsPaginator.ts @@ -0,0 +1,51 @@ +import { Shield } from "../Shield"; +import { ShieldClient } from "../ShieldClient"; +import { + ListProtectionsCommand, + ListProtectionsCommandInput, + ListProtectionsCommandOutput, +} from "../commands/ListProtectionsCommand"; +import { ShieldPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: ShieldClient, + input: ListProtectionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListProtectionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Shield, + input: ListProtectionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listProtections(input, ...args); +}; +export async function* listProtectionsPaginate( + config: ShieldPaginationConfiguration, + input: ListProtectionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListProtectionsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Shield) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof ShieldClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Shield | ShieldClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-signer/index.ts b/clients/client-signer/index.ts index 908a731809bcf..4d0e74f5675d2 100644 --- a/clients/client-signer/index.ts +++ b/clients/client-signer/index.ts @@ -5,11 +5,15 @@ export * from "./commands/DescribeSigningJobCommand"; export * from "./commands/GetSigningPlatformCommand"; export * from "./commands/GetSigningProfileCommand"; export * from "./commands/ListSigningJobsCommand"; +export * from "./pagination/ListSigningJobsPaginator"; export * from "./commands/ListSigningPlatformsCommand"; +export * from "./pagination/ListSigningPlatformsPaginator"; export * from "./commands/ListSigningProfilesCommand"; +export * from "./pagination/ListSigningProfilesPaginator"; export * from "./commands/ListTagsForResourceCommand"; export * from "./commands/PutSigningProfileCommand"; export * from "./commands/StartSigningJobCommand"; export * from "./commands/TagResourceCommand"; export * from "./commands/UntagResourceCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-signer/pagination/Interfaces.ts b/clients/client-signer/pagination/Interfaces.ts new file mode 100644 index 0000000000000..22d5cbc43a138 --- /dev/null +++ b/clients/client-signer/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { Signer } from "../Signer"; +import { SignerClient } from "../SignerClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface SignerPaginationConfiguration extends PaginationConfiguration { + client: Signer | SignerClient; +} diff --git a/clients/client-signer/pagination/ListSigningJobsPaginator.ts b/clients/client-signer/pagination/ListSigningJobsPaginator.ts new file mode 100644 index 0000000000000..ab9cc49012de6 --- /dev/null +++ b/clients/client-signer/pagination/ListSigningJobsPaginator.ts @@ -0,0 +1,51 @@ +import { Signer } from "../Signer"; +import { SignerClient } from "../SignerClient"; +import { + ListSigningJobsCommand, + ListSigningJobsCommandInput, + ListSigningJobsCommandOutput, +} from "../commands/ListSigningJobsCommand"; +import { SignerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SignerClient, + input: ListSigningJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListSigningJobsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Signer, + input: ListSigningJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listSigningJobs(input, ...args); +}; +export async function* listSigningJobsPaginate( + config: SignerPaginationConfiguration, + input: ListSigningJobsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListSigningJobsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof Signer) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SignerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Signer | SignerClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-signer/pagination/ListSigningPlatformsPaginator.ts b/clients/client-signer/pagination/ListSigningPlatformsPaginator.ts new file mode 100644 index 0000000000000..0fccbeb4f1b51 --- /dev/null +++ b/clients/client-signer/pagination/ListSigningPlatformsPaginator.ts @@ -0,0 +1,51 @@ +import { Signer } from "../Signer"; +import { SignerClient } from "../SignerClient"; +import { + ListSigningPlatformsCommand, + ListSigningPlatformsCommandInput, + ListSigningPlatformsCommandOutput, +} from "../commands/ListSigningPlatformsCommand"; +import { SignerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SignerClient, + input: ListSigningPlatformsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListSigningPlatformsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Signer, + input: ListSigningPlatformsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listSigningPlatforms(input, ...args); +}; +export async function* listSigningPlatformsPaginate( + config: SignerPaginationConfiguration, + input: ListSigningPlatformsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListSigningPlatformsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof Signer) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SignerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Signer | SignerClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-signer/pagination/ListSigningProfilesPaginator.ts b/clients/client-signer/pagination/ListSigningProfilesPaginator.ts new file mode 100644 index 0000000000000..9c2ea8a91f033 --- /dev/null +++ b/clients/client-signer/pagination/ListSigningProfilesPaginator.ts @@ -0,0 +1,51 @@ +import { Signer } from "../Signer"; +import { SignerClient } from "../SignerClient"; +import { + ListSigningProfilesCommand, + ListSigningProfilesCommandInput, + ListSigningProfilesCommandOutput, +} from "../commands/ListSigningProfilesCommand"; +import { SignerPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SignerClient, + input: ListSigningProfilesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListSigningProfilesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Signer, + input: ListSigningProfilesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listSigningProfiles(input, ...args); +}; +export async function* listSigningProfilesPaginate( + config: SignerPaginationConfiguration, + input: ListSigningProfilesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListSigningProfilesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof Signer) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SignerClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Signer | SignerClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sms/index.ts b/clients/client-sms/index.ts index e23bb499a3a96..7a2031ceaa3c7 100644 --- a/clients/client-sms/index.ts +++ b/clients/client-sms/index.ts @@ -14,9 +14,13 @@ export * from "./commands/GetAppCommand"; export * from "./commands/GetAppLaunchConfigurationCommand"; export * from "./commands/GetAppReplicationConfigurationCommand"; export * from "./commands/GetConnectorsCommand"; +export * from "./pagination/GetConnectorsPaginator"; export * from "./commands/GetReplicationJobsCommand"; +export * from "./pagination/GetReplicationJobsPaginator"; export * from "./commands/GetReplicationRunsCommand"; +export * from "./pagination/GetReplicationRunsPaginator"; export * from "./commands/GetServersCommand"; +export * from "./pagination/GetServersPaginator"; export * from "./commands/ImportServerCatalogCommand"; export * from "./commands/LaunchAppCommand"; export * from "./commands/ListAppsCommand"; @@ -28,4 +32,5 @@ export * from "./commands/StopAppReplicationCommand"; export * from "./commands/TerminateAppCommand"; export * from "./commands/UpdateAppCommand"; export * from "./commands/UpdateReplicationJobCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-sms/pagination/GetConnectorsPaginator.ts b/clients/client-sms/pagination/GetConnectorsPaginator.ts new file mode 100644 index 0000000000000..22915bba69bf2 --- /dev/null +++ b/clients/client-sms/pagination/GetConnectorsPaginator.ts @@ -0,0 +1,51 @@ +import { SMS } from "../SMS"; +import { SMSClient } from "../SMSClient"; +import { + GetConnectorsCommand, + GetConnectorsCommandInput, + GetConnectorsCommandOutput, +} from "../commands/GetConnectorsCommand"; +import { SMSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SMSClient, + input: GetConnectorsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetConnectorsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SMS, + input: GetConnectorsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getConnectors(input, ...args); +}; +export async function* getConnectorsPaginate( + config: SMSPaginationConfiguration, + input: GetConnectorsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetConnectorsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof SMS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SMSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SMS | SMSClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sms/pagination/GetReplicationJobsPaginator.ts b/clients/client-sms/pagination/GetReplicationJobsPaginator.ts new file mode 100644 index 0000000000000..3726aeeea5e84 --- /dev/null +++ b/clients/client-sms/pagination/GetReplicationJobsPaginator.ts @@ -0,0 +1,51 @@ +import { SMS } from "../SMS"; +import { SMSClient } from "../SMSClient"; +import { + GetReplicationJobsCommand, + GetReplicationJobsCommandInput, + GetReplicationJobsCommandOutput, +} from "../commands/GetReplicationJobsCommand"; +import { SMSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SMSClient, + input: GetReplicationJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetReplicationJobsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SMS, + input: GetReplicationJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getReplicationJobs(input, ...args); +}; +export async function* getReplicationJobsPaginate( + config: SMSPaginationConfiguration, + input: GetReplicationJobsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetReplicationJobsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof SMS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SMSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SMS | SMSClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sms/pagination/GetReplicationRunsPaginator.ts b/clients/client-sms/pagination/GetReplicationRunsPaginator.ts new file mode 100644 index 0000000000000..d728d357e8e52 --- /dev/null +++ b/clients/client-sms/pagination/GetReplicationRunsPaginator.ts @@ -0,0 +1,51 @@ +import { SMS } from "../SMS"; +import { SMSClient } from "../SMSClient"; +import { + GetReplicationRunsCommand, + GetReplicationRunsCommandInput, + GetReplicationRunsCommandOutput, +} from "../commands/GetReplicationRunsCommand"; +import { SMSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SMSClient, + input: GetReplicationRunsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetReplicationRunsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SMS, + input: GetReplicationRunsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getReplicationRuns(input, ...args); +}; +export async function* getReplicationRunsPaginate( + config: SMSPaginationConfiguration, + input: GetReplicationRunsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetReplicationRunsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof SMS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SMSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SMS | SMSClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sms/pagination/GetServersPaginator.ts b/clients/client-sms/pagination/GetServersPaginator.ts new file mode 100644 index 0000000000000..bf94dffbec238 --- /dev/null +++ b/clients/client-sms/pagination/GetServersPaginator.ts @@ -0,0 +1,47 @@ +import { SMS } from "../SMS"; +import { SMSClient } from "../SMSClient"; +import { GetServersCommand, GetServersCommandInput, GetServersCommandOutput } from "../commands/GetServersCommand"; +import { SMSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SMSClient, + input: GetServersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetServersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SMS, + input: GetServersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getServers(input, ...args); +}; +export async function* getServersPaginate( + config: SMSPaginationConfiguration, + input: GetServersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetServersCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof SMS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SMSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SMS | SMSClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sms/pagination/Interfaces.ts b/clients/client-sms/pagination/Interfaces.ts new file mode 100644 index 0000000000000..6f69cf6c6478d --- /dev/null +++ b/clients/client-sms/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { SMS } from "../SMS"; +import { SMSClient } from "../SMSClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface SMSPaginationConfiguration extends PaginationConfiguration { + client: SMS | SMSClient; +} diff --git a/clients/client-snowball/index.ts b/clients/client-snowball/index.ts index 8ca92fa3c1613..a066fbcca8b91 100644 --- a/clients/client-snowball/index.ts +++ b/clients/client-snowball/index.ts @@ -7,6 +7,7 @@ export * from "./commands/CreateClusterCommand"; export * from "./commands/CreateJobCommand"; export * from "./commands/DescribeAddressCommand"; export * from "./commands/DescribeAddressesCommand"; +export * from "./pagination/DescribeAddressesPaginator"; export * from "./commands/DescribeClusterCommand"; export * from "./commands/DescribeJobCommand"; export * from "./commands/GetJobManifestCommand"; @@ -17,6 +18,8 @@ export * from "./commands/ListClusterJobsCommand"; export * from "./commands/ListClustersCommand"; export * from "./commands/ListCompatibleImagesCommand"; export * from "./commands/ListJobsCommand"; +export * from "./pagination/ListJobsPaginator"; export * from "./commands/UpdateClusterCommand"; export * from "./commands/UpdateJobCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-snowball/pagination/DescribeAddressesPaginator.ts b/clients/client-snowball/pagination/DescribeAddressesPaginator.ts new file mode 100644 index 0000000000000..8d4ed27fa3548 --- /dev/null +++ b/clients/client-snowball/pagination/DescribeAddressesPaginator.ts @@ -0,0 +1,51 @@ +import { Snowball } from "../Snowball"; +import { SnowballClient } from "../SnowballClient"; +import { + DescribeAddressesCommand, + DescribeAddressesCommandInput, + DescribeAddressesCommandOutput, +} from "../commands/DescribeAddressesCommand"; +import { SnowballPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SnowballClient, + input: DescribeAddressesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeAddressesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Snowball, + input: DescribeAddressesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeAddresses(input, ...args); +}; +export async function* describeAddressesPaginate( + config: SnowballPaginationConfiguration, + input: DescribeAddressesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeAddressesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Snowball) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SnowballClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Snowball | SnowballClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-snowball/pagination/Interfaces.ts b/clients/client-snowball/pagination/Interfaces.ts new file mode 100644 index 0000000000000..dac22389e2fea --- /dev/null +++ b/clients/client-snowball/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { Snowball } from "../Snowball"; +import { SnowballClient } from "../SnowballClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface SnowballPaginationConfiguration extends PaginationConfiguration { + client: Snowball | SnowballClient; +} diff --git a/clients/client-snowball/pagination/ListJobsPaginator.ts b/clients/client-snowball/pagination/ListJobsPaginator.ts new file mode 100644 index 0000000000000..a1616e6f3282d --- /dev/null +++ b/clients/client-snowball/pagination/ListJobsPaginator.ts @@ -0,0 +1,47 @@ +import { Snowball } from "../Snowball"; +import { SnowballClient } from "../SnowballClient"; +import { ListJobsCommand, ListJobsCommandInput, ListJobsCommandOutput } from "../commands/ListJobsCommand"; +import { SnowballPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SnowballClient, + input: ListJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListJobsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Snowball, + input: ListJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listJobs(input, ...args); +}; +export async function* listJobsPaginate( + config: SnowballPaginationConfiguration, + input: ListJobsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListJobsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Snowball) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SnowballClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Snowball | SnowballClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sns/index.ts b/clients/client-sns/index.ts index 810999e76e32d..9b42bc2328cf5 100644 --- a/clients/client-sns/index.ts +++ b/clients/client-sns/index.ts @@ -15,12 +15,17 @@ export * from "./commands/GetSMSAttributesCommand"; export * from "./commands/GetSubscriptionAttributesCommand"; export * from "./commands/GetTopicAttributesCommand"; export * from "./commands/ListEndpointsByPlatformApplicationCommand"; +export * from "./pagination/ListEndpointsByPlatformApplicationPaginator"; export * from "./commands/ListPhoneNumbersOptedOutCommand"; export * from "./commands/ListPlatformApplicationsCommand"; +export * from "./pagination/ListPlatformApplicationsPaginator"; export * from "./commands/ListSubscriptionsCommand"; +export * from "./pagination/ListSubscriptionsPaginator"; export * from "./commands/ListSubscriptionsByTopicCommand"; +export * from "./pagination/ListSubscriptionsByTopicPaginator"; export * from "./commands/ListTagsForResourceCommand"; export * from "./commands/ListTopicsCommand"; +export * from "./pagination/ListTopicsPaginator"; export * from "./commands/OptInPhoneNumberCommand"; export * from "./commands/PublishCommand"; export * from "./commands/RemovePermissionCommand"; @@ -33,4 +38,5 @@ export * from "./commands/SubscribeCommand"; export * from "./commands/TagResourceCommand"; export * from "./commands/UnsubscribeCommand"; export * from "./commands/UntagResourceCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-sns/pagination/Interfaces.ts b/clients/client-sns/pagination/Interfaces.ts new file mode 100644 index 0000000000000..aeab8a18b99a1 --- /dev/null +++ b/clients/client-sns/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { SNS } from "../SNS"; +import { SNSClient } from "../SNSClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface SNSPaginationConfiguration extends PaginationConfiguration { + client: SNS | SNSClient; +} diff --git a/clients/client-sns/pagination/ListEndpointsByPlatformApplicationPaginator.ts b/clients/client-sns/pagination/ListEndpointsByPlatformApplicationPaginator.ts new file mode 100644 index 0000000000000..4c2de3f960c2a --- /dev/null +++ b/clients/client-sns/pagination/ListEndpointsByPlatformApplicationPaginator.ts @@ -0,0 +1,50 @@ +import { SNS } from "../SNS"; +import { SNSClient } from "../SNSClient"; +import { + ListEndpointsByPlatformApplicationCommand, + ListEndpointsByPlatformApplicationCommandInput, + ListEndpointsByPlatformApplicationCommandOutput, +} from "../commands/ListEndpointsByPlatformApplicationCommand"; +import { SNSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SNSClient, + input: ListEndpointsByPlatformApplicationCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListEndpointsByPlatformApplicationCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SNS, + input: ListEndpointsByPlatformApplicationCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listEndpointsByPlatformApplication(input, ...args); +}; +export async function* listEndpointsByPlatformApplicationPaginate( + config: SNSPaginationConfiguration, + input: ListEndpointsByPlatformApplicationCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListEndpointsByPlatformApplicationCommandOutput; + while (hasNext) { + input["NextToken"] = token; + if (config.client instanceof SNS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SNSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SNS | SNSClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sns/pagination/ListPlatformApplicationsPaginator.ts b/clients/client-sns/pagination/ListPlatformApplicationsPaginator.ts new file mode 100644 index 0000000000000..7838ecefe3286 --- /dev/null +++ b/clients/client-sns/pagination/ListPlatformApplicationsPaginator.ts @@ -0,0 +1,50 @@ +import { SNS } from "../SNS"; +import { SNSClient } from "../SNSClient"; +import { + ListPlatformApplicationsCommand, + ListPlatformApplicationsCommandInput, + ListPlatformApplicationsCommandOutput, +} from "../commands/ListPlatformApplicationsCommand"; +import { SNSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SNSClient, + input: ListPlatformApplicationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListPlatformApplicationsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SNS, + input: ListPlatformApplicationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listPlatformApplications(input, ...args); +}; +export async function* listPlatformApplicationsPaginate( + config: SNSPaginationConfiguration, + input: ListPlatformApplicationsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListPlatformApplicationsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + if (config.client instanceof SNS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SNSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SNS | SNSClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sns/pagination/ListSubscriptionsByTopicPaginator.ts b/clients/client-sns/pagination/ListSubscriptionsByTopicPaginator.ts new file mode 100644 index 0000000000000..17b32d02b491a --- /dev/null +++ b/clients/client-sns/pagination/ListSubscriptionsByTopicPaginator.ts @@ -0,0 +1,50 @@ +import { SNS } from "../SNS"; +import { SNSClient } from "../SNSClient"; +import { + ListSubscriptionsByTopicCommand, + ListSubscriptionsByTopicCommandInput, + ListSubscriptionsByTopicCommandOutput, +} from "../commands/ListSubscriptionsByTopicCommand"; +import { SNSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SNSClient, + input: ListSubscriptionsByTopicCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListSubscriptionsByTopicCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SNS, + input: ListSubscriptionsByTopicCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listSubscriptionsByTopic(input, ...args); +}; +export async function* listSubscriptionsByTopicPaginate( + config: SNSPaginationConfiguration, + input: ListSubscriptionsByTopicCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListSubscriptionsByTopicCommandOutput; + while (hasNext) { + input["NextToken"] = token; + if (config.client instanceof SNS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SNSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SNS | SNSClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sns/pagination/ListSubscriptionsPaginator.ts b/clients/client-sns/pagination/ListSubscriptionsPaginator.ts new file mode 100644 index 0000000000000..2f9b98c55a86f --- /dev/null +++ b/clients/client-sns/pagination/ListSubscriptionsPaginator.ts @@ -0,0 +1,50 @@ +import { SNS } from "../SNS"; +import { SNSClient } from "../SNSClient"; +import { + ListSubscriptionsCommand, + ListSubscriptionsCommandInput, + ListSubscriptionsCommandOutput, +} from "../commands/ListSubscriptionsCommand"; +import { SNSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SNSClient, + input: ListSubscriptionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListSubscriptionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SNS, + input: ListSubscriptionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listSubscriptions(input, ...args); +}; +export async function* listSubscriptionsPaginate( + config: SNSPaginationConfiguration, + input: ListSubscriptionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListSubscriptionsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + if (config.client instanceof SNS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SNSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SNS | SNSClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sns/pagination/ListTopicsPaginator.ts b/clients/client-sns/pagination/ListTopicsPaginator.ts new file mode 100644 index 0000000000000..9a39c2512d13e --- /dev/null +++ b/clients/client-sns/pagination/ListTopicsPaginator.ts @@ -0,0 +1,46 @@ +import { SNS } from "../SNS"; +import { SNSClient } from "../SNSClient"; +import { ListTopicsCommand, ListTopicsCommandInput, ListTopicsCommandOutput } from "../commands/ListTopicsCommand"; +import { SNSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SNSClient, + input: ListTopicsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTopicsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SNS, + input: ListTopicsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTopics(input, ...args); +}; +export async function* listTopicsPaginate( + config: SNSPaginationConfiguration, + input: ListTopicsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTopicsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + if (config.client instanceof SNS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SNSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SNS | SNSClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sqs/index.ts b/clients/client-sqs/index.ts index ca527b496f43e..a157dc2ea26d3 100644 --- a/clients/client-sqs/index.ts +++ b/clients/client-sqs/index.ts @@ -10,6 +10,7 @@ export * from "./commands/DeleteQueueCommand"; export * from "./commands/GetQueueAttributesCommand"; export * from "./commands/GetQueueUrlCommand"; export * from "./commands/ListDeadLetterSourceQueuesCommand"; +export * from "./pagination/ListDeadLetterSourceQueuesPaginator"; export * from "./commands/ListQueuesCommand"; export * from "./commands/ListQueueTagsCommand"; export * from "./commands/PurgeQueueCommand"; @@ -20,4 +21,5 @@ export * from "./commands/SendMessageBatchCommand"; export * from "./commands/SetQueueAttributesCommand"; export * from "./commands/TagQueueCommand"; export * from "./commands/UntagQueueCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-sqs/pagination/Interfaces.ts b/clients/client-sqs/pagination/Interfaces.ts new file mode 100644 index 0000000000000..729735690aa66 --- /dev/null +++ b/clients/client-sqs/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { SQS } from "../SQS"; +import { SQSClient } from "../SQSClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface SQSPaginationConfiguration extends PaginationConfiguration { + client: SQS | SQSClient; +} diff --git a/clients/client-sqs/pagination/ListDeadLetterSourceQueuesPaginator.ts b/clients/client-sqs/pagination/ListDeadLetterSourceQueuesPaginator.ts new file mode 100644 index 0000000000000..3f85ab50f9f0f --- /dev/null +++ b/clients/client-sqs/pagination/ListDeadLetterSourceQueuesPaginator.ts @@ -0,0 +1,51 @@ +import { SQS } from "../SQS"; +import { SQSClient } from "../SQSClient"; +import { + ListDeadLetterSourceQueuesCommand, + ListDeadLetterSourceQueuesCommandInput, + ListDeadLetterSourceQueuesCommandOutput, +} from "../commands/ListDeadLetterSourceQueuesCommand"; +import { SQSPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SQSClient, + input: ListDeadLetterSourceQueuesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDeadLetterSourceQueuesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SQS, + input: ListDeadLetterSourceQueuesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDeadLetterSourceQueues(input, ...args); +}; +export async function* listDeadLetterSourceQueuesPaginate( + config: SQSPaginationConfiguration, + input: ListDeadLetterSourceQueuesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDeadLetterSourceQueuesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SQS) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SQSClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SQS | SQSClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-ssm/index.ts b/clients/client-ssm/index.ts index 7a620cb734737..400ac305eb0b3 100644 --- a/clients/client-ssm/index.ts +++ b/clients/client-ssm/index.ts @@ -25,6 +25,7 @@ export * from "./commands/DeregisterPatchBaselineForPatchGroupCommand"; export * from "./commands/DeregisterTargetFromMaintenanceWindowCommand"; export * from "./commands/DeregisterTaskFromMaintenanceWindowCommand"; export * from "./commands/DescribeActivationsCommand"; +export * from "./pagination/DescribeActivationsPaginator"; export * from "./commands/DescribeAssociationCommand"; export * from "./commands/DescribeAssociationExecutionsCommand"; export * from "./commands/DescribeAssociationExecutionTargetsCommand"; @@ -37,6 +38,7 @@ export * from "./commands/DescribeEffectiveInstanceAssociationsCommand"; export * from "./commands/DescribeEffectivePatchesForPatchBaselineCommand"; export * from "./commands/DescribeInstanceAssociationsStatusCommand"; export * from "./commands/DescribeInstanceInformationCommand"; +export * from "./pagination/DescribeInstanceInformationPaginator"; export * from "./commands/DescribeInstancePatchesCommand"; export * from "./commands/DescribeInstancePatchStatesCommand"; export * from "./commands/DescribeInstancePatchStatesForPatchGroupCommand"; @@ -51,6 +53,7 @@ export * from "./commands/DescribeMaintenanceWindowTargetsCommand"; export * from "./commands/DescribeMaintenanceWindowTasksCommand"; export * from "./commands/DescribeOpsItemsCommand"; export * from "./commands/DescribeParametersCommand"; +export * from "./pagination/DescribeParametersPaginator"; export * from "./commands/DescribePatchBaselinesCommand"; export * from "./commands/DescribePatchGroupsCommand"; export * from "./commands/DescribePatchGroupStateCommand"; @@ -74,19 +77,25 @@ export * from "./commands/GetOpsItemCommand"; export * from "./commands/GetOpsSummaryCommand"; export * from "./commands/GetParameterCommand"; export * from "./commands/GetParameterHistoryCommand"; +export * from "./pagination/GetParameterHistoryPaginator"; export * from "./commands/GetParametersCommand"; export * from "./commands/GetParametersByPathCommand"; +export * from "./pagination/GetParametersByPathPaginator"; export * from "./commands/GetPatchBaselineCommand"; export * from "./commands/GetPatchBaselineForPatchGroupCommand"; export * from "./commands/GetServiceSettingCommand"; export * from "./commands/LabelParameterVersionCommand"; export * from "./commands/ListAssociationsCommand"; +export * from "./pagination/ListAssociationsPaginator"; export * from "./commands/ListAssociationVersionsCommand"; export * from "./commands/ListCommandInvocationsCommand"; +export * from "./pagination/ListCommandInvocationsPaginator"; export * from "./commands/ListCommandsCommand"; +export * from "./pagination/ListCommandsPaginator"; export * from "./commands/ListComplianceItemsCommand"; export * from "./commands/ListComplianceSummariesCommand"; export * from "./commands/ListDocumentsCommand"; +export * from "./pagination/ListDocumentsPaginator"; export * from "./commands/ListDocumentVersionsCommand"; export * from "./commands/ListInventoryEntriesCommand"; export * from "./commands/ListResourceComplianceSummariesCommand"; @@ -122,4 +131,5 @@ export * from "./commands/UpdateOpsItemCommand"; export * from "./commands/UpdatePatchBaselineCommand"; export * from "./commands/UpdateResourceDataSyncCommand"; export * from "./commands/UpdateServiceSettingCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-ssm/pagination/DescribeActivationsPaginator.ts b/clients/client-ssm/pagination/DescribeActivationsPaginator.ts new file mode 100644 index 0000000000000..3151e7c9c5997 --- /dev/null +++ b/clients/client-ssm/pagination/DescribeActivationsPaginator.ts @@ -0,0 +1,51 @@ +import { SSM } from "../SSM"; +import { SSMClient } from "../SSMClient"; +import { + DescribeActivationsCommand, + DescribeActivationsCommandInput, + DescribeActivationsCommandOutput, +} from "../commands/DescribeActivationsCommand"; +import { SSMPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SSMClient, + input: DescribeActivationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeActivationsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SSM, + input: DescribeActivationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeActivations(input, ...args); +}; +export async function* describeActivationsPaginate( + config: SSMPaginationConfiguration, + input: DescribeActivationsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeActivationsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SSM) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SSMClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SSM | SSMClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-ssm/pagination/DescribeInstanceInformationPaginator.ts b/clients/client-ssm/pagination/DescribeInstanceInformationPaginator.ts new file mode 100644 index 0000000000000..1676d474d9f7e --- /dev/null +++ b/clients/client-ssm/pagination/DescribeInstanceInformationPaginator.ts @@ -0,0 +1,51 @@ +import { SSM } from "../SSM"; +import { SSMClient } from "../SSMClient"; +import { + DescribeInstanceInformationCommand, + DescribeInstanceInformationCommandInput, + DescribeInstanceInformationCommandOutput, +} from "../commands/DescribeInstanceInformationCommand"; +import { SSMPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SSMClient, + input: DescribeInstanceInformationCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeInstanceInformationCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SSM, + input: DescribeInstanceInformationCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeInstanceInformation(input, ...args); +}; +export async function* describeInstanceInformationPaginate( + config: SSMPaginationConfiguration, + input: DescribeInstanceInformationCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeInstanceInformationCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SSM) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SSMClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SSM | SSMClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-ssm/pagination/DescribeParametersPaginator.ts b/clients/client-ssm/pagination/DescribeParametersPaginator.ts new file mode 100644 index 0000000000000..589fbe616b78c --- /dev/null +++ b/clients/client-ssm/pagination/DescribeParametersPaginator.ts @@ -0,0 +1,51 @@ +import { SSM } from "../SSM"; +import { SSMClient } from "../SSMClient"; +import { + DescribeParametersCommand, + DescribeParametersCommandInput, + DescribeParametersCommandOutput, +} from "../commands/DescribeParametersCommand"; +import { SSMPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SSMClient, + input: DescribeParametersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeParametersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SSM, + input: DescribeParametersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeParameters(input, ...args); +}; +export async function* describeParametersPaginate( + config: SSMPaginationConfiguration, + input: DescribeParametersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeParametersCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SSM) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SSMClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SSM | SSMClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-ssm/pagination/GetParameterHistoryPaginator.ts b/clients/client-ssm/pagination/GetParameterHistoryPaginator.ts new file mode 100644 index 0000000000000..2022dd08d4988 --- /dev/null +++ b/clients/client-ssm/pagination/GetParameterHistoryPaginator.ts @@ -0,0 +1,51 @@ +import { SSM } from "../SSM"; +import { SSMClient } from "../SSMClient"; +import { + GetParameterHistoryCommand, + GetParameterHistoryCommandInput, + GetParameterHistoryCommandOutput, +} from "../commands/GetParameterHistoryCommand"; +import { SSMPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SSMClient, + input: GetParameterHistoryCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetParameterHistoryCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SSM, + input: GetParameterHistoryCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getParameterHistory(input, ...args); +}; +export async function* getParameterHistoryPaginate( + config: SSMPaginationConfiguration, + input: GetParameterHistoryCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetParameterHistoryCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SSM) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SSMClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SSM | SSMClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-ssm/pagination/GetParametersByPathPaginator.ts b/clients/client-ssm/pagination/GetParametersByPathPaginator.ts new file mode 100644 index 0000000000000..b816d45178a32 --- /dev/null +++ b/clients/client-ssm/pagination/GetParametersByPathPaginator.ts @@ -0,0 +1,51 @@ +import { SSM } from "../SSM"; +import { SSMClient } from "../SSMClient"; +import { + GetParametersByPathCommand, + GetParametersByPathCommandInput, + GetParametersByPathCommandOutput, +} from "../commands/GetParametersByPathCommand"; +import { SSMPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SSMClient, + input: GetParametersByPathCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetParametersByPathCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SSM, + input: GetParametersByPathCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getParametersByPath(input, ...args); +}; +export async function* getParametersByPathPaginate( + config: SSMPaginationConfiguration, + input: GetParametersByPathCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetParametersByPathCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SSM) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SSMClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SSM | SSMClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-ssm/pagination/Interfaces.ts b/clients/client-ssm/pagination/Interfaces.ts new file mode 100644 index 0000000000000..a4617ad37c2a9 --- /dev/null +++ b/clients/client-ssm/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { SSM } from "../SSM"; +import { SSMClient } from "../SSMClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface SSMPaginationConfiguration extends PaginationConfiguration { + client: SSM | SSMClient; +} diff --git a/clients/client-ssm/pagination/ListAssociationsPaginator.ts b/clients/client-ssm/pagination/ListAssociationsPaginator.ts new file mode 100644 index 0000000000000..f9f7f16a663c7 --- /dev/null +++ b/clients/client-ssm/pagination/ListAssociationsPaginator.ts @@ -0,0 +1,51 @@ +import { SSM } from "../SSM"; +import { SSMClient } from "../SSMClient"; +import { + ListAssociationsCommand, + ListAssociationsCommandInput, + ListAssociationsCommandOutput, +} from "../commands/ListAssociationsCommand"; +import { SSMPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SSMClient, + input: ListAssociationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListAssociationsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SSM, + input: ListAssociationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listAssociations(input, ...args); +}; +export async function* listAssociationsPaginate( + config: SSMPaginationConfiguration, + input: ListAssociationsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListAssociationsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SSM) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SSMClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SSM | SSMClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-ssm/pagination/ListCommandInvocationsPaginator.ts b/clients/client-ssm/pagination/ListCommandInvocationsPaginator.ts new file mode 100644 index 0000000000000..60a061823b62b --- /dev/null +++ b/clients/client-ssm/pagination/ListCommandInvocationsPaginator.ts @@ -0,0 +1,51 @@ +import { SSM } from "../SSM"; +import { SSMClient } from "../SSMClient"; +import { + ListCommandInvocationsCommand, + ListCommandInvocationsCommandInput, + ListCommandInvocationsCommandOutput, +} from "../commands/ListCommandInvocationsCommand"; +import { SSMPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SSMClient, + input: ListCommandInvocationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListCommandInvocationsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SSM, + input: ListCommandInvocationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listCommandInvocations(input, ...args); +}; +export async function* listCommandInvocationsPaginate( + config: SSMPaginationConfiguration, + input: ListCommandInvocationsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListCommandInvocationsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SSM) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SSMClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SSM | SSMClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-ssm/pagination/ListCommandsPaginator.ts b/clients/client-ssm/pagination/ListCommandsPaginator.ts new file mode 100644 index 0000000000000..3e9cb6df318b9 --- /dev/null +++ b/clients/client-ssm/pagination/ListCommandsPaginator.ts @@ -0,0 +1,51 @@ +import { SSM } from "../SSM"; +import { SSMClient } from "../SSMClient"; +import { + ListCommandsCommand, + ListCommandsCommandInput, + ListCommandsCommandOutput, +} from "../commands/ListCommandsCommand"; +import { SSMPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SSMClient, + input: ListCommandsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListCommandsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SSM, + input: ListCommandsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listCommands(input, ...args); +}; +export async function* listCommandsPaginate( + config: SSMPaginationConfiguration, + input: ListCommandsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListCommandsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SSM) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SSMClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SSM | SSMClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-ssm/pagination/ListDocumentsPaginator.ts b/clients/client-ssm/pagination/ListDocumentsPaginator.ts new file mode 100644 index 0000000000000..9e410195b6eef --- /dev/null +++ b/clients/client-ssm/pagination/ListDocumentsPaginator.ts @@ -0,0 +1,51 @@ +import { SSM } from "../SSM"; +import { SSMClient } from "../SSMClient"; +import { + ListDocumentsCommand, + ListDocumentsCommandInput, + ListDocumentsCommandOutput, +} from "../commands/ListDocumentsCommand"; +import { SSMPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SSMClient, + input: ListDocumentsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDocumentsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SSM, + input: ListDocumentsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDocuments(input, ...args); +}; +export async function* listDocumentsPaginate( + config: SSMPaginationConfiguration, + input: ListDocumentsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDocumentsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof SSM) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SSMClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SSM | SSMClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sso/index.ts b/clients/client-sso/index.ts index f2ea4de250349..c1eb81187c5fa 100644 --- a/clients/client-sso/index.ts +++ b/clients/client-sso/index.ts @@ -2,6 +2,9 @@ export * from "./SSOClient"; export * from "./SSO"; export * from "./commands/GetRoleCredentialsCommand"; export * from "./commands/ListAccountRolesCommand"; +export * from "./pagination/ListAccountRolesPaginator"; export * from "./commands/ListAccountsCommand"; +export * from "./pagination/ListAccountsPaginator"; export * from "./commands/LogoutCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-sso/pagination/Interfaces.ts b/clients/client-sso/pagination/Interfaces.ts new file mode 100644 index 0000000000000..c41b7f1e8b2c2 --- /dev/null +++ b/clients/client-sso/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { SSO } from "../SSO"; +import { SSOClient } from "../SSOClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface SSOPaginationConfiguration extends PaginationConfiguration { + client: SSO | SSOClient; +} diff --git a/clients/client-sso/pagination/ListAccountRolesPaginator.ts b/clients/client-sso/pagination/ListAccountRolesPaginator.ts new file mode 100644 index 0000000000000..ce6727bc7030a --- /dev/null +++ b/clients/client-sso/pagination/ListAccountRolesPaginator.ts @@ -0,0 +1,51 @@ +import { SSO } from "../SSO"; +import { SSOClient } from "../SSOClient"; +import { + ListAccountRolesCommand, + ListAccountRolesCommandInput, + ListAccountRolesCommandOutput, +} from "../commands/ListAccountRolesCommand"; +import { SSOPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SSOClient, + input: ListAccountRolesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListAccountRolesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SSO, + input: ListAccountRolesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listAccountRoles(input, ...args); +}; +export async function* listAccountRolesPaginate( + config: SSOPaginationConfiguration, + input: ListAccountRolesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListAccountRolesCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof SSO) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SSOClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SSO | SSOClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-sso/pagination/ListAccountsPaginator.ts b/clients/client-sso/pagination/ListAccountsPaginator.ts new file mode 100644 index 0000000000000..4d37d3770640f --- /dev/null +++ b/clients/client-sso/pagination/ListAccountsPaginator.ts @@ -0,0 +1,51 @@ +import { SSO } from "../SSO"; +import { SSOClient } from "../SSOClient"; +import { + ListAccountsCommand, + ListAccountsCommandInput, + ListAccountsCommandOutput, +} from "../commands/ListAccountsCommand"; +import { SSOPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SSOClient, + input: ListAccountsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListAccountsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SSO, + input: ListAccountsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listAccounts(input, ...args); +}; +export async function* listAccountsPaginate( + config: SSOPaginationConfiguration, + input: ListAccountsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListAccountsCommandOutput; + while (hasNext) { + input["nextToken"] = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof SSO) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SSOClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SSO | SSOClient"); + } + yield page; + token = page["nextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-storage-gateway/index.ts b/clients/client-storage-gateway/index.ts index a3d9ff1c5d8b2..2792acf158c90 100644 --- a/clients/client-storage-gateway/index.ts +++ b/clients/client-storage-gateway/index.ts @@ -39,23 +39,32 @@ export * from "./commands/DescribeSMBSettingsCommand"; export * from "./commands/DescribeSnapshotScheduleCommand"; export * from "./commands/DescribeStorediSCSIVolumesCommand"; export * from "./commands/DescribeTapeArchivesCommand"; +export * from "./pagination/DescribeTapeArchivesPaginator"; export * from "./commands/DescribeTapeRecoveryPointsCommand"; +export * from "./pagination/DescribeTapeRecoveryPointsPaginator"; export * from "./commands/DescribeTapesCommand"; +export * from "./pagination/DescribeTapesPaginator"; export * from "./commands/DescribeUploadBufferCommand"; export * from "./commands/DescribeVTLDevicesCommand"; +export * from "./pagination/DescribeVTLDevicesPaginator"; export * from "./commands/DescribeWorkingStorageCommand"; export * from "./commands/DetachVolumeCommand"; export * from "./commands/DisableGatewayCommand"; export * from "./commands/JoinDomainCommand"; export * from "./commands/ListAutomaticTapeCreationPoliciesCommand"; export * from "./commands/ListFileSharesCommand"; +export * from "./pagination/ListFileSharesPaginator"; export * from "./commands/ListGatewaysCommand"; +export * from "./pagination/ListGatewaysPaginator"; export * from "./commands/ListLocalDisksCommand"; export * from "./commands/ListTagsForResourceCommand"; +export * from "./pagination/ListTagsForResourcePaginator"; export * from "./commands/ListTapesCommand"; +export * from "./pagination/ListTapesPaginator"; export * from "./commands/ListVolumeInitiatorsCommand"; export * from "./commands/ListVolumeRecoveryPointsCommand"; export * from "./commands/ListVolumesCommand"; +export * from "./pagination/ListVolumesPaginator"; export * from "./commands/NotifyWhenUploadedCommand"; export * from "./commands/RefreshCacheCommand"; export * from "./commands/RemoveTagsFromResourceCommand"; @@ -78,4 +87,5 @@ export * from "./commands/UpdateSMBFileShareCommand"; export * from "./commands/UpdateSMBSecurityStrategyCommand"; export * from "./commands/UpdateSnapshotScheduleCommand"; export * from "./commands/UpdateVTLDeviceTypeCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-storage-gateway/pagination/DescribeTapeArchivesPaginator.ts b/clients/client-storage-gateway/pagination/DescribeTapeArchivesPaginator.ts new file mode 100644 index 0000000000000..254cc6f860eca --- /dev/null +++ b/clients/client-storage-gateway/pagination/DescribeTapeArchivesPaginator.ts @@ -0,0 +1,51 @@ +import { StorageGateway } from "../StorageGateway"; +import { StorageGatewayClient } from "../StorageGatewayClient"; +import { + DescribeTapeArchivesCommand, + DescribeTapeArchivesCommandInput, + DescribeTapeArchivesCommandOutput, +} from "../commands/DescribeTapeArchivesCommand"; +import { StorageGatewayPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: StorageGatewayClient, + input: DescribeTapeArchivesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeTapeArchivesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: StorageGateway, + input: DescribeTapeArchivesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeTapeArchives(input, ...args); +}; +export async function* describeTapeArchivesPaginate( + config: StorageGatewayPaginationConfiguration, + input: DescribeTapeArchivesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeTapeArchivesCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["Limit"] = config.pageSize; + if (config.client instanceof StorageGateway) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof StorageGatewayClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected StorageGateway | StorageGatewayClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-storage-gateway/pagination/DescribeTapeRecoveryPointsPaginator.ts b/clients/client-storage-gateway/pagination/DescribeTapeRecoveryPointsPaginator.ts new file mode 100644 index 0000000000000..404041b869464 --- /dev/null +++ b/clients/client-storage-gateway/pagination/DescribeTapeRecoveryPointsPaginator.ts @@ -0,0 +1,51 @@ +import { StorageGateway } from "../StorageGateway"; +import { StorageGatewayClient } from "../StorageGatewayClient"; +import { + DescribeTapeRecoveryPointsCommand, + DescribeTapeRecoveryPointsCommandInput, + DescribeTapeRecoveryPointsCommandOutput, +} from "../commands/DescribeTapeRecoveryPointsCommand"; +import { StorageGatewayPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: StorageGatewayClient, + input: DescribeTapeRecoveryPointsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeTapeRecoveryPointsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: StorageGateway, + input: DescribeTapeRecoveryPointsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeTapeRecoveryPoints(input, ...args); +}; +export async function* describeTapeRecoveryPointsPaginate( + config: StorageGatewayPaginationConfiguration, + input: DescribeTapeRecoveryPointsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeTapeRecoveryPointsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["Limit"] = config.pageSize; + if (config.client instanceof StorageGateway) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof StorageGatewayClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected StorageGateway | StorageGatewayClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-storage-gateway/pagination/DescribeTapesPaginator.ts b/clients/client-storage-gateway/pagination/DescribeTapesPaginator.ts new file mode 100644 index 0000000000000..26c4ece712574 --- /dev/null +++ b/clients/client-storage-gateway/pagination/DescribeTapesPaginator.ts @@ -0,0 +1,51 @@ +import { StorageGateway } from "../StorageGateway"; +import { StorageGatewayClient } from "../StorageGatewayClient"; +import { + DescribeTapesCommand, + DescribeTapesCommandInput, + DescribeTapesCommandOutput, +} from "../commands/DescribeTapesCommand"; +import { StorageGatewayPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: StorageGatewayClient, + input: DescribeTapesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeTapesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: StorageGateway, + input: DescribeTapesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeTapes(input, ...args); +}; +export async function* describeTapesPaginate( + config: StorageGatewayPaginationConfiguration, + input: DescribeTapesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeTapesCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["Limit"] = config.pageSize; + if (config.client instanceof StorageGateway) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof StorageGatewayClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected StorageGateway | StorageGatewayClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-storage-gateway/pagination/DescribeVTLDevicesPaginator.ts b/clients/client-storage-gateway/pagination/DescribeVTLDevicesPaginator.ts new file mode 100644 index 0000000000000..35aa88e132135 --- /dev/null +++ b/clients/client-storage-gateway/pagination/DescribeVTLDevicesPaginator.ts @@ -0,0 +1,51 @@ +import { StorageGateway } from "../StorageGateway"; +import { StorageGatewayClient } from "../StorageGatewayClient"; +import { + DescribeVTLDevicesCommand, + DescribeVTLDevicesCommandInput, + DescribeVTLDevicesCommandOutput, +} from "../commands/DescribeVTLDevicesCommand"; +import { StorageGatewayPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: StorageGatewayClient, + input: DescribeVTLDevicesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeVTLDevicesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: StorageGateway, + input: DescribeVTLDevicesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeVTLDevices(input, ...args); +}; +export async function* describeVTLDevicesPaginate( + config: StorageGatewayPaginationConfiguration, + input: DescribeVTLDevicesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeVTLDevicesCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["Limit"] = config.pageSize; + if (config.client instanceof StorageGateway) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof StorageGatewayClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected StorageGateway | StorageGatewayClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-storage-gateway/pagination/Interfaces.ts b/clients/client-storage-gateway/pagination/Interfaces.ts new file mode 100644 index 0000000000000..e87d63c559e1c --- /dev/null +++ b/clients/client-storage-gateway/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { StorageGateway } from "../StorageGateway"; +import { StorageGatewayClient } from "../StorageGatewayClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface StorageGatewayPaginationConfiguration extends PaginationConfiguration { + client: StorageGateway | StorageGatewayClient; +} diff --git a/clients/client-storage-gateway/pagination/ListFileSharesPaginator.ts b/clients/client-storage-gateway/pagination/ListFileSharesPaginator.ts new file mode 100644 index 0000000000000..e6515a48aa7d6 --- /dev/null +++ b/clients/client-storage-gateway/pagination/ListFileSharesPaginator.ts @@ -0,0 +1,51 @@ +import { StorageGateway } from "../StorageGateway"; +import { StorageGatewayClient } from "../StorageGatewayClient"; +import { + ListFileSharesCommand, + ListFileSharesCommandInput, + ListFileSharesCommandOutput, +} from "../commands/ListFileSharesCommand"; +import { StorageGatewayPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: StorageGatewayClient, + input: ListFileSharesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListFileSharesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: StorageGateway, + input: ListFileSharesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listFileShares(input, ...args); +}; +export async function* listFileSharesPaginate( + config: StorageGatewayPaginationConfiguration, + input: ListFileSharesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListFileSharesCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["Limit"] = config.pageSize; + if (config.client instanceof StorageGateway) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof StorageGatewayClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected StorageGateway | StorageGatewayClient"); + } + yield page; + token = page["NextMarker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-storage-gateway/pagination/ListGatewaysPaginator.ts b/clients/client-storage-gateway/pagination/ListGatewaysPaginator.ts new file mode 100644 index 0000000000000..608fd93f688ce --- /dev/null +++ b/clients/client-storage-gateway/pagination/ListGatewaysPaginator.ts @@ -0,0 +1,51 @@ +import { StorageGateway } from "../StorageGateway"; +import { StorageGatewayClient } from "../StorageGatewayClient"; +import { + ListGatewaysCommand, + ListGatewaysCommandInput, + ListGatewaysCommandOutput, +} from "../commands/ListGatewaysCommand"; +import { StorageGatewayPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: StorageGatewayClient, + input: ListGatewaysCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListGatewaysCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: StorageGateway, + input: ListGatewaysCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listGateways(input, ...args); +}; +export async function* listGatewaysPaginate( + config: StorageGatewayPaginationConfiguration, + input: ListGatewaysCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListGatewaysCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["Limit"] = config.pageSize; + if (config.client instanceof StorageGateway) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof StorageGatewayClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected StorageGateway | StorageGatewayClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-storage-gateway/pagination/ListTagsForResourcePaginator.ts b/clients/client-storage-gateway/pagination/ListTagsForResourcePaginator.ts new file mode 100644 index 0000000000000..3f98a88cc383f --- /dev/null +++ b/clients/client-storage-gateway/pagination/ListTagsForResourcePaginator.ts @@ -0,0 +1,51 @@ +import { StorageGateway } from "../StorageGateway"; +import { StorageGatewayClient } from "../StorageGatewayClient"; +import { + ListTagsForResourceCommand, + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput, +} from "../commands/ListTagsForResourceCommand"; +import { StorageGatewayPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: StorageGatewayClient, + input: ListTagsForResourceCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTagsForResourceCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: StorageGateway, + input: ListTagsForResourceCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTagsForResource(input, ...args); +}; +export async function* listTagsForResourcePaginate( + config: StorageGatewayPaginationConfiguration, + input: ListTagsForResourceCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTagsForResourceCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["Limit"] = config.pageSize; + if (config.client instanceof StorageGateway) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof StorageGatewayClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected StorageGateway | StorageGatewayClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-storage-gateway/pagination/ListTapesPaginator.ts b/clients/client-storage-gateway/pagination/ListTapesPaginator.ts new file mode 100644 index 0000000000000..f45b7e0c99b57 --- /dev/null +++ b/clients/client-storage-gateway/pagination/ListTapesPaginator.ts @@ -0,0 +1,47 @@ +import { StorageGateway } from "../StorageGateway"; +import { StorageGatewayClient } from "../StorageGatewayClient"; +import { ListTapesCommand, ListTapesCommandInput, ListTapesCommandOutput } from "../commands/ListTapesCommand"; +import { StorageGatewayPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: StorageGatewayClient, + input: ListTapesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTapesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: StorageGateway, + input: ListTapesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTapes(input, ...args); +}; +export async function* listTapesPaginate( + config: StorageGatewayPaginationConfiguration, + input: ListTapesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTapesCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["Limit"] = config.pageSize; + if (config.client instanceof StorageGateway) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof StorageGatewayClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected StorageGateway | StorageGatewayClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-storage-gateway/pagination/ListVolumesPaginator.ts b/clients/client-storage-gateway/pagination/ListVolumesPaginator.ts new file mode 100644 index 0000000000000..96b5d2ae30689 --- /dev/null +++ b/clients/client-storage-gateway/pagination/ListVolumesPaginator.ts @@ -0,0 +1,47 @@ +import { StorageGateway } from "../StorageGateway"; +import { StorageGatewayClient } from "../StorageGatewayClient"; +import { ListVolumesCommand, ListVolumesCommandInput, ListVolumesCommandOutput } from "../commands/ListVolumesCommand"; +import { StorageGatewayPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: StorageGatewayClient, + input: ListVolumesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListVolumesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: StorageGateway, + input: ListVolumesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listVolumes(input, ...args); +}; +export async function* listVolumesPaginate( + config: StorageGatewayPaginationConfiguration, + input: ListVolumesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListVolumesCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["Limit"] = config.pageSize; + if (config.client instanceof StorageGateway) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof StorageGatewayClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected StorageGateway | StorageGatewayClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-swf/index.ts b/clients/client-swf/index.ts index fb061c2dea346..aafa8167e6cf2 100644 --- a/clients/client-swf/index.ts +++ b/clients/client-swf/index.ts @@ -12,14 +12,21 @@ export * from "./commands/DescribeDomainCommand"; export * from "./commands/DescribeWorkflowExecutionCommand"; export * from "./commands/DescribeWorkflowTypeCommand"; export * from "./commands/GetWorkflowExecutionHistoryCommand"; +export * from "./pagination/GetWorkflowExecutionHistoryPaginator"; export * from "./commands/ListActivityTypesCommand"; +export * from "./pagination/ListActivityTypesPaginator"; export * from "./commands/ListClosedWorkflowExecutionsCommand"; +export * from "./pagination/ListClosedWorkflowExecutionsPaginator"; export * from "./commands/ListDomainsCommand"; +export * from "./pagination/ListDomainsPaginator"; export * from "./commands/ListOpenWorkflowExecutionsCommand"; +export * from "./pagination/ListOpenWorkflowExecutionsPaginator"; export * from "./commands/ListTagsForResourceCommand"; export * from "./commands/ListWorkflowTypesCommand"; +export * from "./pagination/ListWorkflowTypesPaginator"; export * from "./commands/PollForActivityTaskCommand"; export * from "./commands/PollForDecisionTaskCommand"; +export * from "./pagination/PollForDecisionTaskPaginator"; export * from "./commands/RecordActivityTaskHeartbeatCommand"; export * from "./commands/RegisterActivityTypeCommand"; export * from "./commands/RegisterDomainCommand"; @@ -37,4 +44,5 @@ export * from "./commands/UndeprecateActivityTypeCommand"; export * from "./commands/UndeprecateDomainCommand"; export * from "./commands/UndeprecateWorkflowTypeCommand"; export * from "./commands/UntagResourceCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-swf/pagination/GetWorkflowExecutionHistoryPaginator.ts b/clients/client-swf/pagination/GetWorkflowExecutionHistoryPaginator.ts new file mode 100644 index 0000000000000..953d766f234ef --- /dev/null +++ b/clients/client-swf/pagination/GetWorkflowExecutionHistoryPaginator.ts @@ -0,0 +1,51 @@ +import { SWF } from "../SWF"; +import { SWFClient } from "../SWFClient"; +import { + GetWorkflowExecutionHistoryCommand, + GetWorkflowExecutionHistoryCommandInput, + GetWorkflowExecutionHistoryCommandOutput, +} from "../commands/GetWorkflowExecutionHistoryCommand"; +import { SWFPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SWFClient, + input: GetWorkflowExecutionHistoryCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetWorkflowExecutionHistoryCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SWF, + input: GetWorkflowExecutionHistoryCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getWorkflowExecutionHistory(input, ...args); +}; +export async function* getWorkflowExecutionHistoryPaginate( + config: SWFPaginationConfiguration, + input: GetWorkflowExecutionHistoryCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetWorkflowExecutionHistoryCommandOutput; + while (hasNext) { + input["nextPageToken"] = token; + input["maximumPageSize"] = config.pageSize; + if (config.client instanceof SWF) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SWFClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SWF | SWFClient"); + } + yield page; + token = page["nextPageToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-swf/pagination/Interfaces.ts b/clients/client-swf/pagination/Interfaces.ts new file mode 100644 index 0000000000000..6f5d6f617ee0a --- /dev/null +++ b/clients/client-swf/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { SWF } from "../SWF"; +import { SWFClient } from "../SWFClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface SWFPaginationConfiguration extends PaginationConfiguration { + client: SWF | SWFClient; +} diff --git a/clients/client-swf/pagination/ListActivityTypesPaginator.ts b/clients/client-swf/pagination/ListActivityTypesPaginator.ts new file mode 100644 index 0000000000000..a338ed1dd6b3a --- /dev/null +++ b/clients/client-swf/pagination/ListActivityTypesPaginator.ts @@ -0,0 +1,51 @@ +import { SWF } from "../SWF"; +import { SWFClient } from "../SWFClient"; +import { + ListActivityTypesCommand, + ListActivityTypesCommandInput, + ListActivityTypesCommandOutput, +} from "../commands/ListActivityTypesCommand"; +import { SWFPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SWFClient, + input: ListActivityTypesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListActivityTypesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SWF, + input: ListActivityTypesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listActivityTypes(input, ...args); +}; +export async function* listActivityTypesPaginate( + config: SWFPaginationConfiguration, + input: ListActivityTypesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListActivityTypesCommandOutput; + while (hasNext) { + input["nextPageToken"] = token; + input["maximumPageSize"] = config.pageSize; + if (config.client instanceof SWF) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SWFClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SWF | SWFClient"); + } + yield page; + token = page["nextPageToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-swf/pagination/ListClosedWorkflowExecutionsPaginator.ts b/clients/client-swf/pagination/ListClosedWorkflowExecutionsPaginator.ts new file mode 100644 index 0000000000000..e014b6602a9fa --- /dev/null +++ b/clients/client-swf/pagination/ListClosedWorkflowExecutionsPaginator.ts @@ -0,0 +1,51 @@ +import { SWF } from "../SWF"; +import { SWFClient } from "../SWFClient"; +import { + ListClosedWorkflowExecutionsCommand, + ListClosedWorkflowExecutionsCommandInput, + ListClosedWorkflowExecutionsCommandOutput, +} from "../commands/ListClosedWorkflowExecutionsCommand"; +import { SWFPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SWFClient, + input: ListClosedWorkflowExecutionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListClosedWorkflowExecutionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SWF, + input: ListClosedWorkflowExecutionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listClosedWorkflowExecutions(input, ...args); +}; +export async function* listClosedWorkflowExecutionsPaginate( + config: SWFPaginationConfiguration, + input: ListClosedWorkflowExecutionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListClosedWorkflowExecutionsCommandOutput; + while (hasNext) { + input["nextPageToken"] = token; + input["maximumPageSize"] = config.pageSize; + if (config.client instanceof SWF) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SWFClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SWF | SWFClient"); + } + yield page; + token = page["nextPageToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-swf/pagination/ListDomainsPaginator.ts b/clients/client-swf/pagination/ListDomainsPaginator.ts new file mode 100644 index 0000000000000..9a5a6c33eb267 --- /dev/null +++ b/clients/client-swf/pagination/ListDomainsPaginator.ts @@ -0,0 +1,47 @@ +import { SWF } from "../SWF"; +import { SWFClient } from "../SWFClient"; +import { ListDomainsCommand, ListDomainsCommandInput, ListDomainsCommandOutput } from "../commands/ListDomainsCommand"; +import { SWFPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SWFClient, + input: ListDomainsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDomainsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SWF, + input: ListDomainsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDomains(input, ...args); +}; +export async function* listDomainsPaginate( + config: SWFPaginationConfiguration, + input: ListDomainsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDomainsCommandOutput; + while (hasNext) { + input["nextPageToken"] = token; + input["maximumPageSize"] = config.pageSize; + if (config.client instanceof SWF) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SWFClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SWF | SWFClient"); + } + yield page; + token = page["nextPageToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-swf/pagination/ListOpenWorkflowExecutionsPaginator.ts b/clients/client-swf/pagination/ListOpenWorkflowExecutionsPaginator.ts new file mode 100644 index 0000000000000..242d6a4deae81 --- /dev/null +++ b/clients/client-swf/pagination/ListOpenWorkflowExecutionsPaginator.ts @@ -0,0 +1,51 @@ +import { SWF } from "../SWF"; +import { SWFClient } from "../SWFClient"; +import { + ListOpenWorkflowExecutionsCommand, + ListOpenWorkflowExecutionsCommandInput, + ListOpenWorkflowExecutionsCommandOutput, +} from "../commands/ListOpenWorkflowExecutionsCommand"; +import { SWFPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SWFClient, + input: ListOpenWorkflowExecutionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListOpenWorkflowExecutionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SWF, + input: ListOpenWorkflowExecutionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listOpenWorkflowExecutions(input, ...args); +}; +export async function* listOpenWorkflowExecutionsPaginate( + config: SWFPaginationConfiguration, + input: ListOpenWorkflowExecutionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListOpenWorkflowExecutionsCommandOutput; + while (hasNext) { + input["nextPageToken"] = token; + input["maximumPageSize"] = config.pageSize; + if (config.client instanceof SWF) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SWFClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SWF | SWFClient"); + } + yield page; + token = page["nextPageToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-swf/pagination/ListWorkflowTypesPaginator.ts b/clients/client-swf/pagination/ListWorkflowTypesPaginator.ts new file mode 100644 index 0000000000000..dcb573bc66f79 --- /dev/null +++ b/clients/client-swf/pagination/ListWorkflowTypesPaginator.ts @@ -0,0 +1,51 @@ +import { SWF } from "../SWF"; +import { SWFClient } from "../SWFClient"; +import { + ListWorkflowTypesCommand, + ListWorkflowTypesCommandInput, + ListWorkflowTypesCommandOutput, +} from "../commands/ListWorkflowTypesCommand"; +import { SWFPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SWFClient, + input: ListWorkflowTypesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListWorkflowTypesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SWF, + input: ListWorkflowTypesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listWorkflowTypes(input, ...args); +}; +export async function* listWorkflowTypesPaginate( + config: SWFPaginationConfiguration, + input: ListWorkflowTypesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListWorkflowTypesCommandOutput; + while (hasNext) { + input["nextPageToken"] = token; + input["maximumPageSize"] = config.pageSize; + if (config.client instanceof SWF) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SWFClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SWF | SWFClient"); + } + yield page; + token = page["nextPageToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-swf/pagination/PollForDecisionTaskPaginator.ts b/clients/client-swf/pagination/PollForDecisionTaskPaginator.ts new file mode 100644 index 0000000000000..8aa96aea610a5 --- /dev/null +++ b/clients/client-swf/pagination/PollForDecisionTaskPaginator.ts @@ -0,0 +1,51 @@ +import { SWF } from "../SWF"; +import { SWFClient } from "../SWFClient"; +import { + PollForDecisionTaskCommand, + PollForDecisionTaskCommandInput, + PollForDecisionTaskCommandOutput, +} from "../commands/PollForDecisionTaskCommand"; +import { SWFPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SWFClient, + input: PollForDecisionTaskCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new PollForDecisionTaskCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: SWF, + input: PollForDecisionTaskCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.pollForDecisionTask(input, ...args); +}; +export async function* pollForDecisionTaskPaginate( + config: SWFPaginationConfiguration, + input: PollForDecisionTaskCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: PollForDecisionTaskCommandOutput; + while (hasNext) { + input["nextPageToken"] = token; + input["maximumPageSize"] = config.pageSize; + if (config.client instanceof SWF) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SWFClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected SWF | SWFClient"); + } + yield page; + token = page["nextPageToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-synthetics/index.ts b/clients/client-synthetics/index.ts index 725ed6f800a09..8b5264b324afa 100644 --- a/clients/client-synthetics/index.ts +++ b/clients/client-synthetics/index.ts @@ -3,14 +3,19 @@ export * from "./Synthetics"; export * from "./commands/CreateCanaryCommand"; export * from "./commands/DeleteCanaryCommand"; export * from "./commands/DescribeCanariesCommand"; +export * from "./pagination/DescribeCanariesPaginator"; export * from "./commands/DescribeCanariesLastRunCommand"; +export * from "./pagination/DescribeCanariesLastRunPaginator"; export * from "./commands/DescribeRuntimeVersionsCommand"; +export * from "./pagination/DescribeRuntimeVersionsPaginator"; export * from "./commands/GetCanaryCommand"; export * from "./commands/GetCanaryRunsCommand"; +export * from "./pagination/GetCanaryRunsPaginator"; export * from "./commands/ListTagsForResourceCommand"; export * from "./commands/StartCanaryCommand"; export * from "./commands/StopCanaryCommand"; export * from "./commands/TagResourceCommand"; export * from "./commands/UntagResourceCommand"; export * from "./commands/UpdateCanaryCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-synthetics/pagination/DescribeCanariesLastRunPaginator.ts b/clients/client-synthetics/pagination/DescribeCanariesLastRunPaginator.ts new file mode 100644 index 0000000000000..db857339d7ac9 --- /dev/null +++ b/clients/client-synthetics/pagination/DescribeCanariesLastRunPaginator.ts @@ -0,0 +1,51 @@ +import { Synthetics } from "../Synthetics"; +import { SyntheticsClient } from "../SyntheticsClient"; +import { + DescribeCanariesLastRunCommand, + DescribeCanariesLastRunCommandInput, + DescribeCanariesLastRunCommandOutput, +} from "../commands/DescribeCanariesLastRunCommand"; +import { SyntheticsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SyntheticsClient, + input: DescribeCanariesLastRunCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeCanariesLastRunCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Synthetics, + input: DescribeCanariesLastRunCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeCanariesLastRun(input, ...args); +}; +export async function* describeCanariesLastRunPaginate( + config: SyntheticsPaginationConfiguration, + input: DescribeCanariesLastRunCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeCanariesLastRunCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Synthetics) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SyntheticsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Synthetics | SyntheticsClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-synthetics/pagination/DescribeCanariesPaginator.ts b/clients/client-synthetics/pagination/DescribeCanariesPaginator.ts new file mode 100644 index 0000000000000..0a276d28b42b5 --- /dev/null +++ b/clients/client-synthetics/pagination/DescribeCanariesPaginator.ts @@ -0,0 +1,51 @@ +import { Synthetics } from "../Synthetics"; +import { SyntheticsClient } from "../SyntheticsClient"; +import { + DescribeCanariesCommand, + DescribeCanariesCommandInput, + DescribeCanariesCommandOutput, +} from "../commands/DescribeCanariesCommand"; +import { SyntheticsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SyntheticsClient, + input: DescribeCanariesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeCanariesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Synthetics, + input: DescribeCanariesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeCanaries(input, ...args); +}; +export async function* describeCanariesPaginate( + config: SyntheticsPaginationConfiguration, + input: DescribeCanariesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeCanariesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Synthetics) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SyntheticsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Synthetics | SyntheticsClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-synthetics/pagination/DescribeRuntimeVersionsPaginator.ts b/clients/client-synthetics/pagination/DescribeRuntimeVersionsPaginator.ts new file mode 100644 index 0000000000000..eb71964bbacab --- /dev/null +++ b/clients/client-synthetics/pagination/DescribeRuntimeVersionsPaginator.ts @@ -0,0 +1,51 @@ +import { Synthetics } from "../Synthetics"; +import { SyntheticsClient } from "../SyntheticsClient"; +import { + DescribeRuntimeVersionsCommand, + DescribeRuntimeVersionsCommandInput, + DescribeRuntimeVersionsCommandOutput, +} from "../commands/DescribeRuntimeVersionsCommand"; +import { SyntheticsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SyntheticsClient, + input: DescribeRuntimeVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeRuntimeVersionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Synthetics, + input: DescribeRuntimeVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeRuntimeVersions(input, ...args); +}; +export async function* describeRuntimeVersionsPaginate( + config: SyntheticsPaginationConfiguration, + input: DescribeRuntimeVersionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeRuntimeVersionsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Synthetics) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SyntheticsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Synthetics | SyntheticsClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-synthetics/pagination/GetCanaryRunsPaginator.ts b/clients/client-synthetics/pagination/GetCanaryRunsPaginator.ts new file mode 100644 index 0000000000000..f61094c765c1d --- /dev/null +++ b/clients/client-synthetics/pagination/GetCanaryRunsPaginator.ts @@ -0,0 +1,51 @@ +import { Synthetics } from "../Synthetics"; +import { SyntheticsClient } from "../SyntheticsClient"; +import { + GetCanaryRunsCommand, + GetCanaryRunsCommandInput, + GetCanaryRunsCommandOutput, +} from "../commands/GetCanaryRunsCommand"; +import { SyntheticsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: SyntheticsClient, + input: GetCanaryRunsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetCanaryRunsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Synthetics, + input: GetCanaryRunsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getCanaryRuns(input, ...args); +}; +export async function* getCanaryRunsPaginate( + config: SyntheticsPaginationConfiguration, + input: GetCanaryRunsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetCanaryRunsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Synthetics) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof SyntheticsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Synthetics | SyntheticsClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-synthetics/pagination/Interfaces.ts b/clients/client-synthetics/pagination/Interfaces.ts new file mode 100644 index 0000000000000..7aa16eca49113 --- /dev/null +++ b/clients/client-synthetics/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { Synthetics } from "../Synthetics"; +import { SyntheticsClient } from "../SyntheticsClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface SyntheticsPaginationConfiguration extends PaginationConfiguration { + client: Synthetics | SyntheticsClient; +} diff --git a/clients/client-transcribe/index.ts b/clients/client-transcribe/index.ts index 422ef1d9c792f..47f59030bf998 100644 --- a/clients/client-transcribe/index.ts +++ b/clients/client-transcribe/index.ts @@ -14,13 +14,19 @@ export * from "./commands/GetTranscriptionJobCommand"; export * from "./commands/GetVocabularyCommand"; export * from "./commands/GetVocabularyFilterCommand"; export * from "./commands/ListMedicalTranscriptionJobsCommand"; +export * from "./pagination/ListMedicalTranscriptionJobsPaginator"; export * from "./commands/ListMedicalVocabulariesCommand"; +export * from "./pagination/ListMedicalVocabulariesPaginator"; export * from "./commands/ListTranscriptionJobsCommand"; +export * from "./pagination/ListTranscriptionJobsPaginator"; export * from "./commands/ListVocabulariesCommand"; +export * from "./pagination/ListVocabulariesPaginator"; export * from "./commands/ListVocabularyFiltersCommand"; +export * from "./pagination/ListVocabularyFiltersPaginator"; export * from "./commands/StartMedicalTranscriptionJobCommand"; export * from "./commands/StartTranscriptionJobCommand"; export * from "./commands/UpdateMedicalVocabularyCommand"; export * from "./commands/UpdateVocabularyCommand"; export * from "./commands/UpdateVocabularyFilterCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-transcribe/pagination/Interfaces.ts b/clients/client-transcribe/pagination/Interfaces.ts new file mode 100644 index 0000000000000..269e10c0b1441 --- /dev/null +++ b/clients/client-transcribe/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { Transcribe } from "../Transcribe"; +import { TranscribeClient } from "../TranscribeClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface TranscribePaginationConfiguration extends PaginationConfiguration { + client: Transcribe | TranscribeClient; +} diff --git a/clients/client-transcribe/pagination/ListMedicalTranscriptionJobsPaginator.ts b/clients/client-transcribe/pagination/ListMedicalTranscriptionJobsPaginator.ts new file mode 100644 index 0000000000000..2a790e6b5523a --- /dev/null +++ b/clients/client-transcribe/pagination/ListMedicalTranscriptionJobsPaginator.ts @@ -0,0 +1,51 @@ +import { Transcribe } from "../Transcribe"; +import { TranscribeClient } from "../TranscribeClient"; +import { + ListMedicalTranscriptionJobsCommand, + ListMedicalTranscriptionJobsCommandInput, + ListMedicalTranscriptionJobsCommandOutput, +} from "../commands/ListMedicalTranscriptionJobsCommand"; +import { TranscribePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: TranscribeClient, + input: ListMedicalTranscriptionJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListMedicalTranscriptionJobsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Transcribe, + input: ListMedicalTranscriptionJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listMedicalTranscriptionJobs(input, ...args); +}; +export async function* listMedicalTranscriptionJobsPaginate( + config: TranscribePaginationConfiguration, + input: ListMedicalTranscriptionJobsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListMedicalTranscriptionJobsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Transcribe) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof TranscribeClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Transcribe | TranscribeClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-transcribe/pagination/ListMedicalVocabulariesPaginator.ts b/clients/client-transcribe/pagination/ListMedicalVocabulariesPaginator.ts new file mode 100644 index 0000000000000..71cac1134d7bc --- /dev/null +++ b/clients/client-transcribe/pagination/ListMedicalVocabulariesPaginator.ts @@ -0,0 +1,51 @@ +import { Transcribe } from "../Transcribe"; +import { TranscribeClient } from "../TranscribeClient"; +import { + ListMedicalVocabulariesCommand, + ListMedicalVocabulariesCommandInput, + ListMedicalVocabulariesCommandOutput, +} from "../commands/ListMedicalVocabulariesCommand"; +import { TranscribePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: TranscribeClient, + input: ListMedicalVocabulariesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListMedicalVocabulariesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Transcribe, + input: ListMedicalVocabulariesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listMedicalVocabularies(input, ...args); +}; +export async function* listMedicalVocabulariesPaginate( + config: TranscribePaginationConfiguration, + input: ListMedicalVocabulariesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListMedicalVocabulariesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Transcribe) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof TranscribeClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Transcribe | TranscribeClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-transcribe/pagination/ListTranscriptionJobsPaginator.ts b/clients/client-transcribe/pagination/ListTranscriptionJobsPaginator.ts new file mode 100644 index 0000000000000..df387eee2fb1f --- /dev/null +++ b/clients/client-transcribe/pagination/ListTranscriptionJobsPaginator.ts @@ -0,0 +1,51 @@ +import { Transcribe } from "../Transcribe"; +import { TranscribeClient } from "../TranscribeClient"; +import { + ListTranscriptionJobsCommand, + ListTranscriptionJobsCommandInput, + ListTranscriptionJobsCommandOutput, +} from "../commands/ListTranscriptionJobsCommand"; +import { TranscribePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: TranscribeClient, + input: ListTranscriptionJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTranscriptionJobsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Transcribe, + input: ListTranscriptionJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTranscriptionJobs(input, ...args); +}; +export async function* listTranscriptionJobsPaginate( + config: TranscribePaginationConfiguration, + input: ListTranscriptionJobsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTranscriptionJobsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Transcribe) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof TranscribeClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Transcribe | TranscribeClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-transcribe/pagination/ListVocabulariesPaginator.ts b/clients/client-transcribe/pagination/ListVocabulariesPaginator.ts new file mode 100644 index 0000000000000..cef5a9ee9ab67 --- /dev/null +++ b/clients/client-transcribe/pagination/ListVocabulariesPaginator.ts @@ -0,0 +1,51 @@ +import { Transcribe } from "../Transcribe"; +import { TranscribeClient } from "../TranscribeClient"; +import { + ListVocabulariesCommand, + ListVocabulariesCommandInput, + ListVocabulariesCommandOutput, +} from "../commands/ListVocabulariesCommand"; +import { TranscribePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: TranscribeClient, + input: ListVocabulariesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListVocabulariesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Transcribe, + input: ListVocabulariesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listVocabularies(input, ...args); +}; +export async function* listVocabulariesPaginate( + config: TranscribePaginationConfiguration, + input: ListVocabulariesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListVocabulariesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Transcribe) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof TranscribeClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Transcribe | TranscribeClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-transcribe/pagination/ListVocabularyFiltersPaginator.ts b/clients/client-transcribe/pagination/ListVocabularyFiltersPaginator.ts new file mode 100644 index 0000000000000..6b7ca07f0ee3c --- /dev/null +++ b/clients/client-transcribe/pagination/ListVocabularyFiltersPaginator.ts @@ -0,0 +1,51 @@ +import { Transcribe } from "../Transcribe"; +import { TranscribeClient } from "../TranscribeClient"; +import { + ListVocabularyFiltersCommand, + ListVocabularyFiltersCommandInput, + ListVocabularyFiltersCommandOutput, +} from "../commands/ListVocabularyFiltersCommand"; +import { TranscribePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: TranscribeClient, + input: ListVocabularyFiltersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListVocabularyFiltersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Transcribe, + input: ListVocabularyFiltersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listVocabularyFilters(input, ...args); +}; +export async function* listVocabularyFiltersPaginate( + config: TranscribePaginationConfiguration, + input: ListVocabularyFiltersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListVocabularyFiltersCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Transcribe) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof TranscribeClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Transcribe | TranscribeClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-transfer/index.ts b/clients/client-transfer/index.ts index 1480f1bb089ce..fefafa060da81 100644 --- a/clients/client-transfer/index.ts +++ b/clients/client-transfer/index.ts @@ -9,8 +9,11 @@ export * from "./commands/DescribeServerCommand"; export * from "./commands/DescribeUserCommand"; export * from "./commands/ImportSshPublicKeyCommand"; export * from "./commands/ListServersCommand"; +export * from "./pagination/ListServersPaginator"; export * from "./commands/ListTagsForResourceCommand"; +export * from "./pagination/ListTagsForResourcePaginator"; export * from "./commands/ListUsersCommand"; +export * from "./pagination/ListUsersPaginator"; export * from "./commands/StartServerCommand"; export * from "./commands/StopServerCommand"; export * from "./commands/TagResourceCommand"; @@ -18,4 +21,5 @@ export * from "./commands/TestIdentityProviderCommand"; export * from "./commands/UntagResourceCommand"; export * from "./commands/UpdateServerCommand"; export * from "./commands/UpdateUserCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-transfer/pagination/Interfaces.ts b/clients/client-transfer/pagination/Interfaces.ts new file mode 100644 index 0000000000000..be066a320371e --- /dev/null +++ b/clients/client-transfer/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { Transfer } from "../Transfer"; +import { TransferClient } from "../TransferClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface TransferPaginationConfiguration extends PaginationConfiguration { + client: Transfer | TransferClient; +} diff --git a/clients/client-transfer/pagination/ListServersPaginator.ts b/clients/client-transfer/pagination/ListServersPaginator.ts new file mode 100644 index 0000000000000..724c7d1e51144 --- /dev/null +++ b/clients/client-transfer/pagination/ListServersPaginator.ts @@ -0,0 +1,47 @@ +import { Transfer } from "../Transfer"; +import { TransferClient } from "../TransferClient"; +import { ListServersCommand, ListServersCommandInput, ListServersCommandOutput } from "../commands/ListServersCommand"; +import { TransferPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: TransferClient, + input: ListServersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListServersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Transfer, + input: ListServersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listServers(input, ...args); +}; +export async function* listServersPaginate( + config: TransferPaginationConfiguration, + input: ListServersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListServersCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Transfer) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof TransferClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Transfer | TransferClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-transfer/pagination/ListTagsForResourcePaginator.ts b/clients/client-transfer/pagination/ListTagsForResourcePaginator.ts new file mode 100644 index 0000000000000..c67d7b52cba67 --- /dev/null +++ b/clients/client-transfer/pagination/ListTagsForResourcePaginator.ts @@ -0,0 +1,51 @@ +import { Transfer } from "../Transfer"; +import { TransferClient } from "../TransferClient"; +import { + ListTagsForResourceCommand, + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput, +} from "../commands/ListTagsForResourceCommand"; +import { TransferPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: TransferClient, + input: ListTagsForResourceCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTagsForResourceCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Transfer, + input: ListTagsForResourceCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTagsForResource(input, ...args); +}; +export async function* listTagsForResourcePaginate( + config: TransferPaginationConfiguration, + input: ListTagsForResourceCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTagsForResourceCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Transfer) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof TransferClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Transfer | TransferClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-transfer/pagination/ListUsersPaginator.ts b/clients/client-transfer/pagination/ListUsersPaginator.ts new file mode 100644 index 0000000000000..a68a082730b6e --- /dev/null +++ b/clients/client-transfer/pagination/ListUsersPaginator.ts @@ -0,0 +1,47 @@ +import { Transfer } from "../Transfer"; +import { TransferClient } from "../TransferClient"; +import { ListUsersCommand, ListUsersCommandInput, ListUsersCommandOutput } from "../commands/ListUsersCommand"; +import { TransferPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: TransferClient, + input: ListUsersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListUsersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Transfer, + input: ListUsersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listUsers(input, ...args); +}; +export async function* listUsersPaginate( + config: TransferPaginationConfiguration, + input: ListUsersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListUsersCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Transfer) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof TransferClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Transfer | TransferClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-translate/index.ts b/clients/client-translate/index.ts index 16f5230ee33ef..b6b75450bb4bc 100644 --- a/clients/client-translate/index.ts +++ b/clients/client-translate/index.ts @@ -5,8 +5,11 @@ export * from "./commands/DescribeTextTranslationJobCommand"; export * from "./commands/GetTerminologyCommand"; export * from "./commands/ImportTerminologyCommand"; export * from "./commands/ListTerminologiesCommand"; +export * from "./pagination/ListTerminologiesPaginator"; export * from "./commands/ListTextTranslationJobsCommand"; +export * from "./pagination/ListTextTranslationJobsPaginator"; export * from "./commands/StartTextTranslationJobCommand"; export * from "./commands/StopTextTranslationJobCommand"; export * from "./commands/TranslateTextCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-translate/pagination/Interfaces.ts b/clients/client-translate/pagination/Interfaces.ts new file mode 100644 index 0000000000000..849f8823f84af --- /dev/null +++ b/clients/client-translate/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { Translate } from "../Translate"; +import { TranslateClient } from "../TranslateClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface TranslatePaginationConfiguration extends PaginationConfiguration { + client: Translate | TranslateClient; +} diff --git a/clients/client-translate/pagination/ListTerminologiesPaginator.ts b/clients/client-translate/pagination/ListTerminologiesPaginator.ts new file mode 100644 index 0000000000000..6d195c09c8e54 --- /dev/null +++ b/clients/client-translate/pagination/ListTerminologiesPaginator.ts @@ -0,0 +1,51 @@ +import { Translate } from "../Translate"; +import { TranslateClient } from "../TranslateClient"; +import { + ListTerminologiesCommand, + ListTerminologiesCommandInput, + ListTerminologiesCommandOutput, +} from "../commands/ListTerminologiesCommand"; +import { TranslatePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: TranslateClient, + input: ListTerminologiesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTerminologiesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Translate, + input: ListTerminologiesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTerminologies(input, ...args); +}; +export async function* listTerminologiesPaginate( + config: TranslatePaginationConfiguration, + input: ListTerminologiesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTerminologiesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Translate) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof TranslateClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Translate | TranslateClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-translate/pagination/ListTextTranslationJobsPaginator.ts b/clients/client-translate/pagination/ListTextTranslationJobsPaginator.ts new file mode 100644 index 0000000000000..741f5fad23d7b --- /dev/null +++ b/clients/client-translate/pagination/ListTextTranslationJobsPaginator.ts @@ -0,0 +1,51 @@ +import { Translate } from "../Translate"; +import { TranslateClient } from "../TranslateClient"; +import { + ListTextTranslationJobsCommand, + ListTextTranslationJobsCommandInput, + ListTextTranslationJobsCommandOutput, +} from "../commands/ListTextTranslationJobsCommand"; +import { TranslatePaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: TranslateClient, + input: ListTextTranslationJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListTextTranslationJobsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: Translate, + input: ListTextTranslationJobsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listTextTranslationJobs(input, ...args); +}; +export async function* listTextTranslationJobsPaginate( + config: TranslatePaginationConfiguration, + input: ListTextTranslationJobsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListTextTranslationJobsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof Translate) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof TranslateClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Translate | TranslateClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-workdocs/index.ts b/clients/client-workdocs/index.ts index f325f43933038..c10ecf89cfb16 100644 --- a/clients/client-workdocs/index.ts +++ b/clients/client-workdocs/index.ts @@ -21,12 +21,15 @@ export * from "./commands/DeleteUserCommand"; export * from "./commands/DescribeActivitiesCommand"; export * from "./commands/DescribeCommentsCommand"; export * from "./commands/DescribeDocumentVersionsCommand"; +export * from "./pagination/DescribeDocumentVersionsPaginator"; export * from "./commands/DescribeFolderContentsCommand"; +export * from "./pagination/DescribeFolderContentsPaginator"; export * from "./commands/DescribeGroupsCommand"; export * from "./commands/DescribeNotificationSubscriptionsCommand"; export * from "./commands/DescribeResourcePermissionsCommand"; export * from "./commands/DescribeRootFoldersCommand"; export * from "./commands/DescribeUsersCommand"; +export * from "./pagination/DescribeUsersPaginator"; export * from "./commands/GetCurrentUserCommand"; export * from "./commands/GetDocumentCommand"; export * from "./commands/GetDocumentPathCommand"; @@ -41,4 +44,5 @@ export * from "./commands/UpdateDocumentCommand"; export * from "./commands/UpdateDocumentVersionCommand"; export * from "./commands/UpdateFolderCommand"; export * from "./commands/UpdateUserCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-workdocs/pagination/DescribeDocumentVersionsPaginator.ts b/clients/client-workdocs/pagination/DescribeDocumentVersionsPaginator.ts new file mode 100644 index 0000000000000..083eaa154db6b --- /dev/null +++ b/clients/client-workdocs/pagination/DescribeDocumentVersionsPaginator.ts @@ -0,0 +1,51 @@ +import { WorkDocs } from "../WorkDocs"; +import { WorkDocsClient } from "../WorkDocsClient"; +import { + DescribeDocumentVersionsCommand, + DescribeDocumentVersionsCommandInput, + DescribeDocumentVersionsCommandOutput, +} from "../commands/DescribeDocumentVersionsCommand"; +import { WorkDocsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: WorkDocsClient, + input: DescribeDocumentVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeDocumentVersionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: WorkDocs, + input: DescribeDocumentVersionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeDocumentVersions(input, ...args); +}; +export async function* describeDocumentVersionsPaginate( + config: WorkDocsPaginationConfiguration, + input: DescribeDocumentVersionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeDocumentVersionsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["Limit"] = config.pageSize; + if (config.client instanceof WorkDocs) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof WorkDocsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected WorkDocs | WorkDocsClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-workdocs/pagination/DescribeFolderContentsPaginator.ts b/clients/client-workdocs/pagination/DescribeFolderContentsPaginator.ts new file mode 100644 index 0000000000000..1bbe506696444 --- /dev/null +++ b/clients/client-workdocs/pagination/DescribeFolderContentsPaginator.ts @@ -0,0 +1,51 @@ +import { WorkDocs } from "../WorkDocs"; +import { WorkDocsClient } from "../WorkDocsClient"; +import { + DescribeFolderContentsCommand, + DescribeFolderContentsCommandInput, + DescribeFolderContentsCommandOutput, +} from "../commands/DescribeFolderContentsCommand"; +import { WorkDocsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: WorkDocsClient, + input: DescribeFolderContentsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeFolderContentsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: WorkDocs, + input: DescribeFolderContentsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeFolderContents(input, ...args); +}; +export async function* describeFolderContentsPaginate( + config: WorkDocsPaginationConfiguration, + input: DescribeFolderContentsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeFolderContentsCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["Limit"] = config.pageSize; + if (config.client instanceof WorkDocs) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof WorkDocsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected WorkDocs | WorkDocsClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-workdocs/pagination/DescribeUsersPaginator.ts b/clients/client-workdocs/pagination/DescribeUsersPaginator.ts new file mode 100644 index 0000000000000..c7d56ec326686 --- /dev/null +++ b/clients/client-workdocs/pagination/DescribeUsersPaginator.ts @@ -0,0 +1,51 @@ +import { WorkDocs } from "../WorkDocs"; +import { WorkDocsClient } from "../WorkDocsClient"; +import { + DescribeUsersCommand, + DescribeUsersCommandInput, + DescribeUsersCommandOutput, +} from "../commands/DescribeUsersCommand"; +import { WorkDocsPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: WorkDocsClient, + input: DescribeUsersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeUsersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: WorkDocs, + input: DescribeUsersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeUsers(input, ...args); +}; +export async function* describeUsersPaginate( + config: WorkDocsPaginationConfiguration, + input: DescribeUsersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeUsersCommandOutput; + while (hasNext) { + input["Marker"] = token; + input["Limit"] = config.pageSize; + if (config.client instanceof WorkDocs) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof WorkDocsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected WorkDocs | WorkDocsClient"); + } + yield page; + token = page["Marker"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-workdocs/pagination/Interfaces.ts b/clients/client-workdocs/pagination/Interfaces.ts new file mode 100644 index 0000000000000..53fa09273f933 --- /dev/null +++ b/clients/client-workdocs/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { WorkDocs } from "../WorkDocs"; +import { WorkDocsClient } from "../WorkDocsClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface WorkDocsPaginationConfiguration extends PaginationConfiguration { + client: WorkDocs | WorkDocsClient; +} diff --git a/clients/client-worklink/index.ts b/clients/client-worklink/index.ts index d184d34086429..9b2ab83609e98 100644 --- a/clients/client-worklink/index.ts +++ b/clients/client-worklink/index.ts @@ -17,11 +17,16 @@ export * from "./commands/DisassociateDomainCommand"; export * from "./commands/DisassociateWebsiteAuthorizationProviderCommand"; export * from "./commands/DisassociateWebsiteCertificateAuthorityCommand"; export * from "./commands/ListDevicesCommand"; +export * from "./pagination/ListDevicesPaginator"; export * from "./commands/ListDomainsCommand"; +export * from "./pagination/ListDomainsPaginator"; export * from "./commands/ListFleetsCommand"; +export * from "./pagination/ListFleetsPaginator"; export * from "./commands/ListTagsForResourceCommand"; export * from "./commands/ListWebsiteAuthorizationProvidersCommand"; +export * from "./pagination/ListWebsiteAuthorizationProvidersPaginator"; export * from "./commands/ListWebsiteCertificateAuthoritiesCommand"; +export * from "./pagination/ListWebsiteCertificateAuthoritiesPaginator"; export * from "./commands/RestoreDomainAccessCommand"; export * from "./commands/RevokeDomainAccessCommand"; export * from "./commands/SignOutUserCommand"; @@ -33,4 +38,5 @@ export * from "./commands/UpdateDevicePolicyConfigurationCommand"; export * from "./commands/UpdateDomainMetadataCommand"; export * from "./commands/UpdateFleetMetadataCommand"; export * from "./commands/UpdateIdentityProviderConfigurationCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-worklink/pagination/Interfaces.ts b/clients/client-worklink/pagination/Interfaces.ts new file mode 100644 index 0000000000000..391578754d5b8 --- /dev/null +++ b/clients/client-worklink/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { WorkLink } from "../WorkLink"; +import { WorkLinkClient } from "../WorkLinkClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface WorkLinkPaginationConfiguration extends PaginationConfiguration { + client: WorkLink | WorkLinkClient; +} diff --git a/clients/client-worklink/pagination/ListDevicesPaginator.ts b/clients/client-worklink/pagination/ListDevicesPaginator.ts new file mode 100644 index 0000000000000..7584024ebb4d5 --- /dev/null +++ b/clients/client-worklink/pagination/ListDevicesPaginator.ts @@ -0,0 +1,47 @@ +import { WorkLink } from "../WorkLink"; +import { WorkLinkClient } from "../WorkLinkClient"; +import { ListDevicesCommand, ListDevicesCommandInput, ListDevicesCommandOutput } from "../commands/ListDevicesCommand"; +import { WorkLinkPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: WorkLinkClient, + input: ListDevicesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDevicesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: WorkLink, + input: ListDevicesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDevices(input, ...args); +}; +export async function* listDevicesPaginate( + config: WorkLinkPaginationConfiguration, + input: ListDevicesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDevicesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof WorkLink) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof WorkLinkClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected WorkLink | WorkLinkClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-worklink/pagination/ListDomainsPaginator.ts b/clients/client-worklink/pagination/ListDomainsPaginator.ts new file mode 100644 index 0000000000000..33a5c3036f33a --- /dev/null +++ b/clients/client-worklink/pagination/ListDomainsPaginator.ts @@ -0,0 +1,47 @@ +import { WorkLink } from "../WorkLink"; +import { WorkLinkClient } from "../WorkLinkClient"; +import { ListDomainsCommand, ListDomainsCommandInput, ListDomainsCommandOutput } from "../commands/ListDomainsCommand"; +import { WorkLinkPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: WorkLinkClient, + input: ListDomainsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListDomainsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: WorkLink, + input: ListDomainsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listDomains(input, ...args); +}; +export async function* listDomainsPaginate( + config: WorkLinkPaginationConfiguration, + input: ListDomainsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListDomainsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof WorkLink) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof WorkLinkClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected WorkLink | WorkLinkClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-worklink/pagination/ListFleetsPaginator.ts b/clients/client-worklink/pagination/ListFleetsPaginator.ts new file mode 100644 index 0000000000000..39055c135a98a --- /dev/null +++ b/clients/client-worklink/pagination/ListFleetsPaginator.ts @@ -0,0 +1,47 @@ +import { WorkLink } from "../WorkLink"; +import { WorkLinkClient } from "../WorkLinkClient"; +import { ListFleetsCommand, ListFleetsCommandInput, ListFleetsCommandOutput } from "../commands/ListFleetsCommand"; +import { WorkLinkPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: WorkLinkClient, + input: ListFleetsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListFleetsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: WorkLink, + input: ListFleetsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listFleets(input, ...args); +}; +export async function* listFleetsPaginate( + config: WorkLinkPaginationConfiguration, + input: ListFleetsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListFleetsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof WorkLink) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof WorkLinkClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected WorkLink | WorkLinkClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-worklink/pagination/ListWebsiteAuthorizationProvidersPaginator.ts b/clients/client-worklink/pagination/ListWebsiteAuthorizationProvidersPaginator.ts new file mode 100644 index 0000000000000..7baad02aa450b --- /dev/null +++ b/clients/client-worklink/pagination/ListWebsiteAuthorizationProvidersPaginator.ts @@ -0,0 +1,51 @@ +import { WorkLink } from "../WorkLink"; +import { WorkLinkClient } from "../WorkLinkClient"; +import { + ListWebsiteAuthorizationProvidersCommand, + ListWebsiteAuthorizationProvidersCommandInput, + ListWebsiteAuthorizationProvidersCommandOutput, +} from "../commands/ListWebsiteAuthorizationProvidersCommand"; +import { WorkLinkPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: WorkLinkClient, + input: ListWebsiteAuthorizationProvidersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListWebsiteAuthorizationProvidersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: WorkLink, + input: ListWebsiteAuthorizationProvidersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listWebsiteAuthorizationProviders(input, ...args); +}; +export async function* listWebsiteAuthorizationProvidersPaginate( + config: WorkLinkPaginationConfiguration, + input: ListWebsiteAuthorizationProvidersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListWebsiteAuthorizationProvidersCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof WorkLink) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof WorkLinkClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected WorkLink | WorkLinkClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-worklink/pagination/ListWebsiteCertificateAuthoritiesPaginator.ts b/clients/client-worklink/pagination/ListWebsiteCertificateAuthoritiesPaginator.ts new file mode 100644 index 0000000000000..9a0e7b154b0ff --- /dev/null +++ b/clients/client-worklink/pagination/ListWebsiteCertificateAuthoritiesPaginator.ts @@ -0,0 +1,51 @@ +import { WorkLink } from "../WorkLink"; +import { WorkLinkClient } from "../WorkLinkClient"; +import { + ListWebsiteCertificateAuthoritiesCommand, + ListWebsiteCertificateAuthoritiesCommandInput, + ListWebsiteCertificateAuthoritiesCommandOutput, +} from "../commands/ListWebsiteCertificateAuthoritiesCommand"; +import { WorkLinkPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: WorkLinkClient, + input: ListWebsiteCertificateAuthoritiesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListWebsiteCertificateAuthoritiesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: WorkLink, + input: ListWebsiteCertificateAuthoritiesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listWebsiteCertificateAuthorities(input, ...args); +}; +export async function* listWebsiteCertificateAuthoritiesPaginate( + config: WorkLinkPaginationConfiguration, + input: ListWebsiteCertificateAuthoritiesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListWebsiteCertificateAuthoritiesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof WorkLink) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof WorkLinkClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected WorkLink | WorkLinkClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-workmail/index.ts b/clients/client-workmail/index.ts index 14787c37124b7..e3ce9a3a91cc9 100644 --- a/clients/client-workmail/index.ts +++ b/clients/client-workmail/index.ts @@ -20,17 +20,26 @@ export * from "./commands/DisassociateDelegateFromResourceCommand"; export * from "./commands/DisassociateMemberFromGroupCommand"; export * from "./commands/GetMailboxDetailsCommand"; export * from "./commands/ListAliasesCommand"; +export * from "./pagination/ListAliasesPaginator"; export * from "./commands/ListGroupMembersCommand"; +export * from "./pagination/ListGroupMembersPaginator"; export * from "./commands/ListGroupsCommand"; +export * from "./pagination/ListGroupsPaginator"; export * from "./commands/ListMailboxPermissionsCommand"; +export * from "./pagination/ListMailboxPermissionsPaginator"; export * from "./commands/ListOrganizationsCommand"; +export * from "./pagination/ListOrganizationsPaginator"; export * from "./commands/ListResourceDelegatesCommand"; +export * from "./pagination/ListResourceDelegatesPaginator"; export * from "./commands/ListResourcesCommand"; +export * from "./pagination/ListResourcesPaginator"; export * from "./commands/ListUsersCommand"; +export * from "./pagination/ListUsersPaginator"; export * from "./commands/PutMailboxPermissionsCommand"; export * from "./commands/RegisterToWorkMailCommand"; export * from "./commands/ResetPasswordCommand"; export * from "./commands/UpdateMailboxQuotaCommand"; export * from "./commands/UpdatePrimaryEmailAddressCommand"; export * from "./commands/UpdateResourceCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-workmail/pagination/Interfaces.ts b/clients/client-workmail/pagination/Interfaces.ts new file mode 100644 index 0000000000000..42eefbc7bd2e9 --- /dev/null +++ b/clients/client-workmail/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { WorkMail } from "../WorkMail"; +import { WorkMailClient } from "../WorkMailClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface WorkMailPaginationConfiguration extends PaginationConfiguration { + client: WorkMail | WorkMailClient; +} diff --git a/clients/client-workmail/pagination/ListAliasesPaginator.ts b/clients/client-workmail/pagination/ListAliasesPaginator.ts new file mode 100644 index 0000000000000..aef41f024ed02 --- /dev/null +++ b/clients/client-workmail/pagination/ListAliasesPaginator.ts @@ -0,0 +1,47 @@ +import { WorkMail } from "../WorkMail"; +import { WorkMailClient } from "../WorkMailClient"; +import { ListAliasesCommand, ListAliasesCommandInput, ListAliasesCommandOutput } from "../commands/ListAliasesCommand"; +import { WorkMailPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: WorkMailClient, + input: ListAliasesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListAliasesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: WorkMail, + input: ListAliasesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listAliases(input, ...args); +}; +export async function* listAliasesPaginate( + config: WorkMailPaginationConfiguration, + input: ListAliasesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListAliasesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof WorkMail) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof WorkMailClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected WorkMail | WorkMailClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-workmail/pagination/ListGroupMembersPaginator.ts b/clients/client-workmail/pagination/ListGroupMembersPaginator.ts new file mode 100644 index 0000000000000..bb59c9d478272 --- /dev/null +++ b/clients/client-workmail/pagination/ListGroupMembersPaginator.ts @@ -0,0 +1,51 @@ +import { WorkMail } from "../WorkMail"; +import { WorkMailClient } from "../WorkMailClient"; +import { + ListGroupMembersCommand, + ListGroupMembersCommandInput, + ListGroupMembersCommandOutput, +} from "../commands/ListGroupMembersCommand"; +import { WorkMailPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: WorkMailClient, + input: ListGroupMembersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListGroupMembersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: WorkMail, + input: ListGroupMembersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listGroupMembers(input, ...args); +}; +export async function* listGroupMembersPaginate( + config: WorkMailPaginationConfiguration, + input: ListGroupMembersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListGroupMembersCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof WorkMail) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof WorkMailClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected WorkMail | WorkMailClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-workmail/pagination/ListGroupsPaginator.ts b/clients/client-workmail/pagination/ListGroupsPaginator.ts new file mode 100644 index 0000000000000..1eceb314518ae --- /dev/null +++ b/clients/client-workmail/pagination/ListGroupsPaginator.ts @@ -0,0 +1,47 @@ +import { WorkMail } from "../WorkMail"; +import { WorkMailClient } from "../WorkMailClient"; +import { ListGroupsCommand, ListGroupsCommandInput, ListGroupsCommandOutput } from "../commands/ListGroupsCommand"; +import { WorkMailPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: WorkMailClient, + input: ListGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListGroupsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: WorkMail, + input: ListGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listGroups(input, ...args); +}; +export async function* listGroupsPaginate( + config: WorkMailPaginationConfiguration, + input: ListGroupsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListGroupsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof WorkMail) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof WorkMailClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected WorkMail | WorkMailClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-workmail/pagination/ListMailboxPermissionsPaginator.ts b/clients/client-workmail/pagination/ListMailboxPermissionsPaginator.ts new file mode 100644 index 0000000000000..6767a3b6fbdaf --- /dev/null +++ b/clients/client-workmail/pagination/ListMailboxPermissionsPaginator.ts @@ -0,0 +1,51 @@ +import { WorkMail } from "../WorkMail"; +import { WorkMailClient } from "../WorkMailClient"; +import { + ListMailboxPermissionsCommand, + ListMailboxPermissionsCommandInput, + ListMailboxPermissionsCommandOutput, +} from "../commands/ListMailboxPermissionsCommand"; +import { WorkMailPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: WorkMailClient, + input: ListMailboxPermissionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListMailboxPermissionsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: WorkMail, + input: ListMailboxPermissionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listMailboxPermissions(input, ...args); +}; +export async function* listMailboxPermissionsPaginate( + config: WorkMailPaginationConfiguration, + input: ListMailboxPermissionsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListMailboxPermissionsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof WorkMail) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof WorkMailClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected WorkMail | WorkMailClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-workmail/pagination/ListOrganizationsPaginator.ts b/clients/client-workmail/pagination/ListOrganizationsPaginator.ts new file mode 100644 index 0000000000000..782bcdb916ea8 --- /dev/null +++ b/clients/client-workmail/pagination/ListOrganizationsPaginator.ts @@ -0,0 +1,51 @@ +import { WorkMail } from "../WorkMail"; +import { WorkMailClient } from "../WorkMailClient"; +import { + ListOrganizationsCommand, + ListOrganizationsCommandInput, + ListOrganizationsCommandOutput, +} from "../commands/ListOrganizationsCommand"; +import { WorkMailPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: WorkMailClient, + input: ListOrganizationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListOrganizationsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: WorkMail, + input: ListOrganizationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listOrganizations(input, ...args); +}; +export async function* listOrganizationsPaginate( + config: WorkMailPaginationConfiguration, + input: ListOrganizationsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListOrganizationsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof WorkMail) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof WorkMailClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected WorkMail | WorkMailClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-workmail/pagination/ListResourceDelegatesPaginator.ts b/clients/client-workmail/pagination/ListResourceDelegatesPaginator.ts new file mode 100644 index 0000000000000..cf0697e4eea3d --- /dev/null +++ b/clients/client-workmail/pagination/ListResourceDelegatesPaginator.ts @@ -0,0 +1,51 @@ +import { WorkMail } from "../WorkMail"; +import { WorkMailClient } from "../WorkMailClient"; +import { + ListResourceDelegatesCommand, + ListResourceDelegatesCommandInput, + ListResourceDelegatesCommandOutput, +} from "../commands/ListResourceDelegatesCommand"; +import { WorkMailPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: WorkMailClient, + input: ListResourceDelegatesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListResourceDelegatesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: WorkMail, + input: ListResourceDelegatesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listResourceDelegates(input, ...args); +}; +export async function* listResourceDelegatesPaginate( + config: WorkMailPaginationConfiguration, + input: ListResourceDelegatesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListResourceDelegatesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof WorkMail) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof WorkMailClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected WorkMail | WorkMailClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-workmail/pagination/ListResourcesPaginator.ts b/clients/client-workmail/pagination/ListResourcesPaginator.ts new file mode 100644 index 0000000000000..7a6bfe962ab80 --- /dev/null +++ b/clients/client-workmail/pagination/ListResourcesPaginator.ts @@ -0,0 +1,51 @@ +import { WorkMail } from "../WorkMail"; +import { WorkMailClient } from "../WorkMailClient"; +import { + ListResourcesCommand, + ListResourcesCommandInput, + ListResourcesCommandOutput, +} from "../commands/ListResourcesCommand"; +import { WorkMailPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: WorkMailClient, + input: ListResourcesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListResourcesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: WorkMail, + input: ListResourcesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listResources(input, ...args); +}; +export async function* listResourcesPaginate( + config: WorkMailPaginationConfiguration, + input: ListResourcesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListResourcesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof WorkMail) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof WorkMailClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected WorkMail | WorkMailClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-workmail/pagination/ListUsersPaginator.ts b/clients/client-workmail/pagination/ListUsersPaginator.ts new file mode 100644 index 0000000000000..d2b32ddb7a846 --- /dev/null +++ b/clients/client-workmail/pagination/ListUsersPaginator.ts @@ -0,0 +1,47 @@ +import { WorkMail } from "../WorkMail"; +import { WorkMailClient } from "../WorkMailClient"; +import { ListUsersCommand, ListUsersCommandInput, ListUsersCommandOutput } from "../commands/ListUsersCommand"; +import { WorkMailPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: WorkMailClient, + input: ListUsersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListUsersCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: WorkMail, + input: ListUsersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listUsers(input, ...args); +}; +export async function* listUsersPaginate( + config: WorkMailPaginationConfiguration, + input: ListUsersCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: ListUsersCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof WorkMail) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof WorkMailClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected WorkMail | WorkMailClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-workspaces/index.ts b/clients/client-workspaces/index.ts index 8055640ffe71a..d22342ca681f3 100644 --- a/clients/client-workspaces/index.ts +++ b/clients/client-workspaces/index.ts @@ -16,10 +16,13 @@ export * from "./commands/DescribeClientPropertiesCommand"; export * from "./commands/DescribeIpGroupsCommand"; export * from "./commands/DescribeTagsCommand"; export * from "./commands/DescribeWorkspaceBundlesCommand"; +export * from "./pagination/DescribeWorkspaceBundlesPaginator"; export * from "./commands/DescribeWorkspaceDirectoriesCommand"; +export * from "./pagination/DescribeWorkspaceDirectoriesPaginator"; export * from "./commands/DescribeWorkspaceImagePermissionsCommand"; export * from "./commands/DescribeWorkspaceImagesCommand"; export * from "./commands/DescribeWorkspacesCommand"; +export * from "./pagination/DescribeWorkspacesPaginator"; export * from "./commands/DescribeWorkspacesConnectionStatusCommand"; export * from "./commands/DescribeWorkspaceSnapshotsCommand"; export * from "./commands/DisassociateIpGroupsCommand"; @@ -43,4 +46,5 @@ export * from "./commands/StopWorkspacesCommand"; export * from "./commands/TerminateWorkspacesCommand"; export * from "./commands/UpdateRulesOfIpGroupCommand"; export * from "./commands/UpdateWorkspaceImagePermissionCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-workspaces/pagination/DescribeWorkspaceBundlesPaginator.ts b/clients/client-workspaces/pagination/DescribeWorkspaceBundlesPaginator.ts new file mode 100644 index 0000000000000..9ebf56a4b473a --- /dev/null +++ b/clients/client-workspaces/pagination/DescribeWorkspaceBundlesPaginator.ts @@ -0,0 +1,50 @@ +import { WorkSpaces } from "../WorkSpaces"; +import { WorkSpacesClient } from "../WorkSpacesClient"; +import { + DescribeWorkspaceBundlesCommand, + DescribeWorkspaceBundlesCommandInput, + DescribeWorkspaceBundlesCommandOutput, +} from "../commands/DescribeWorkspaceBundlesCommand"; +import { WorkSpacesPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: WorkSpacesClient, + input: DescribeWorkspaceBundlesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeWorkspaceBundlesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: WorkSpaces, + input: DescribeWorkspaceBundlesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeWorkspaceBundles(input, ...args); +}; +export async function* describeWorkspaceBundlesPaginate( + config: WorkSpacesPaginationConfiguration, + input: DescribeWorkspaceBundlesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeWorkspaceBundlesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + if (config.client instanceof WorkSpaces) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof WorkSpacesClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected WorkSpaces | WorkSpacesClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-workspaces/pagination/DescribeWorkspaceDirectoriesPaginator.ts b/clients/client-workspaces/pagination/DescribeWorkspaceDirectoriesPaginator.ts new file mode 100644 index 0000000000000..e61f10b22975c --- /dev/null +++ b/clients/client-workspaces/pagination/DescribeWorkspaceDirectoriesPaginator.ts @@ -0,0 +1,50 @@ +import { WorkSpaces } from "../WorkSpaces"; +import { WorkSpacesClient } from "../WorkSpacesClient"; +import { + DescribeWorkspaceDirectoriesCommand, + DescribeWorkspaceDirectoriesCommandInput, + DescribeWorkspaceDirectoriesCommandOutput, +} from "../commands/DescribeWorkspaceDirectoriesCommand"; +import { WorkSpacesPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: WorkSpacesClient, + input: DescribeWorkspaceDirectoriesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeWorkspaceDirectoriesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: WorkSpaces, + input: DescribeWorkspaceDirectoriesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeWorkspaceDirectories(input, ...args); +}; +export async function* describeWorkspaceDirectoriesPaginate( + config: WorkSpacesPaginationConfiguration, + input: DescribeWorkspaceDirectoriesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeWorkspaceDirectoriesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + if (config.client instanceof WorkSpaces) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof WorkSpacesClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected WorkSpaces | WorkSpacesClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-workspaces/pagination/DescribeWorkspacesPaginator.ts b/clients/client-workspaces/pagination/DescribeWorkspacesPaginator.ts new file mode 100644 index 0000000000000..673cf4a85489d --- /dev/null +++ b/clients/client-workspaces/pagination/DescribeWorkspacesPaginator.ts @@ -0,0 +1,51 @@ +import { WorkSpaces } from "../WorkSpaces"; +import { WorkSpacesClient } from "../WorkSpacesClient"; +import { + DescribeWorkspacesCommand, + DescribeWorkspacesCommandInput, + DescribeWorkspacesCommandOutput, +} from "../commands/DescribeWorkspacesCommand"; +import { WorkSpacesPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: WorkSpacesClient, + input: DescribeWorkspacesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeWorkspacesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: WorkSpaces, + input: DescribeWorkspacesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.describeWorkspaces(input, ...args); +}; +export async function* describeWorkspacesPaginate( + config: WorkSpacesPaginationConfiguration, + input: DescribeWorkspacesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: DescribeWorkspacesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + input["Limit"] = config.pageSize; + if (config.client instanceof WorkSpaces) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof WorkSpacesClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected WorkSpaces | WorkSpacesClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-workspaces/pagination/Interfaces.ts b/clients/client-workspaces/pagination/Interfaces.ts new file mode 100644 index 0000000000000..40137366d67c1 --- /dev/null +++ b/clients/client-workspaces/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { WorkSpaces } from "../WorkSpaces"; +import { WorkSpacesClient } from "../WorkSpacesClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface WorkSpacesPaginationConfiguration extends PaginationConfiguration { + client: WorkSpaces | WorkSpacesClient; +} diff --git a/clients/client-xray/index.ts b/clients/client-xray/index.ts index 0cdea853bd4e1..358de261e1912 100644 --- a/clients/client-xray/index.ts +++ b/clients/client-xray/index.ts @@ -1,6 +1,7 @@ export * from "./XRayClient"; export * from "./XRay"; export * from "./commands/BatchGetTracesCommand"; +export * from "./pagination/BatchGetTracesPaginator"; export * from "./commands/CreateGroupCommand"; export * from "./commands/CreateSamplingRuleCommand"; export * from "./commands/DeleteGroupCommand"; @@ -8,16 +9,24 @@ export * from "./commands/DeleteSamplingRuleCommand"; export * from "./commands/GetEncryptionConfigCommand"; export * from "./commands/GetGroupCommand"; export * from "./commands/GetGroupsCommand"; +export * from "./pagination/GetGroupsPaginator"; export * from "./commands/GetSamplingRulesCommand"; +export * from "./pagination/GetSamplingRulesPaginator"; export * from "./commands/GetSamplingStatisticSummariesCommand"; +export * from "./pagination/GetSamplingStatisticSummariesPaginator"; export * from "./commands/GetSamplingTargetsCommand"; export * from "./commands/GetServiceGraphCommand"; +export * from "./pagination/GetServiceGraphPaginator"; export * from "./commands/GetTimeSeriesServiceStatisticsCommand"; +export * from "./pagination/GetTimeSeriesServiceStatisticsPaginator"; export * from "./commands/GetTraceGraphCommand"; +export * from "./pagination/GetTraceGraphPaginator"; export * from "./commands/GetTraceSummariesCommand"; +export * from "./pagination/GetTraceSummariesPaginator"; export * from "./commands/PutEncryptionConfigCommand"; export * from "./commands/PutTelemetryRecordsCommand"; export * from "./commands/PutTraceSegmentsCommand"; export * from "./commands/UpdateGroupCommand"; export * from "./commands/UpdateSamplingRuleCommand"; +export * from "./pagination/Interfaces"; export * from "./models/index"; diff --git a/clients/client-xray/pagination/BatchGetTracesPaginator.ts b/clients/client-xray/pagination/BatchGetTracesPaginator.ts new file mode 100644 index 0000000000000..26efb01a81338 --- /dev/null +++ b/clients/client-xray/pagination/BatchGetTracesPaginator.ts @@ -0,0 +1,50 @@ +import { XRay } from "../XRay"; +import { XRayClient } from "../XRayClient"; +import { + BatchGetTracesCommand, + BatchGetTracesCommandInput, + BatchGetTracesCommandOutput, +} from "../commands/BatchGetTracesCommand"; +import { XRayPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: XRayClient, + input: BatchGetTracesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new BatchGetTracesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: XRay, + input: BatchGetTracesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.batchGetTraces(input, ...args); +}; +export async function* batchGetTracesPaginate( + config: XRayPaginationConfiguration, + input: BatchGetTracesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: BatchGetTracesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + if (config.client instanceof XRay) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof XRayClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected XRay | XRayClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-xray/pagination/GetGroupsPaginator.ts b/clients/client-xray/pagination/GetGroupsPaginator.ts new file mode 100644 index 0000000000000..d46675306d7ff --- /dev/null +++ b/clients/client-xray/pagination/GetGroupsPaginator.ts @@ -0,0 +1,46 @@ +import { XRay } from "../XRay"; +import { XRayClient } from "../XRayClient"; +import { GetGroupsCommand, GetGroupsCommandInput, GetGroupsCommandOutput } from "../commands/GetGroupsCommand"; +import { XRayPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: XRayClient, + input: GetGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetGroupsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: XRay, + input: GetGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getGroups(input, ...args); +}; +export async function* getGroupsPaginate( + config: XRayPaginationConfiguration, + input: GetGroupsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetGroupsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + if (config.client instanceof XRay) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof XRayClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected XRay | XRayClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-xray/pagination/GetSamplingRulesPaginator.ts b/clients/client-xray/pagination/GetSamplingRulesPaginator.ts new file mode 100644 index 0000000000000..7609903f2b4fd --- /dev/null +++ b/clients/client-xray/pagination/GetSamplingRulesPaginator.ts @@ -0,0 +1,50 @@ +import { XRay } from "../XRay"; +import { XRayClient } from "../XRayClient"; +import { + GetSamplingRulesCommand, + GetSamplingRulesCommandInput, + GetSamplingRulesCommandOutput, +} from "../commands/GetSamplingRulesCommand"; +import { XRayPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: XRayClient, + input: GetSamplingRulesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetSamplingRulesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: XRay, + input: GetSamplingRulesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getSamplingRules(input, ...args); +}; +export async function* getSamplingRulesPaginate( + config: XRayPaginationConfiguration, + input: GetSamplingRulesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetSamplingRulesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + if (config.client instanceof XRay) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof XRayClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected XRay | XRayClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-xray/pagination/GetSamplingStatisticSummariesPaginator.ts b/clients/client-xray/pagination/GetSamplingStatisticSummariesPaginator.ts new file mode 100644 index 0000000000000..4079f208855ea --- /dev/null +++ b/clients/client-xray/pagination/GetSamplingStatisticSummariesPaginator.ts @@ -0,0 +1,50 @@ +import { XRay } from "../XRay"; +import { XRayClient } from "../XRayClient"; +import { + GetSamplingStatisticSummariesCommand, + GetSamplingStatisticSummariesCommandInput, + GetSamplingStatisticSummariesCommandOutput, +} from "../commands/GetSamplingStatisticSummariesCommand"; +import { XRayPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: XRayClient, + input: GetSamplingStatisticSummariesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetSamplingStatisticSummariesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: XRay, + input: GetSamplingStatisticSummariesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getSamplingStatisticSummaries(input, ...args); +}; +export async function* getSamplingStatisticSummariesPaginate( + config: XRayPaginationConfiguration, + input: GetSamplingStatisticSummariesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetSamplingStatisticSummariesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + if (config.client instanceof XRay) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof XRayClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected XRay | XRayClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-xray/pagination/GetServiceGraphPaginator.ts b/clients/client-xray/pagination/GetServiceGraphPaginator.ts new file mode 100644 index 0000000000000..e73e930cca90f --- /dev/null +++ b/clients/client-xray/pagination/GetServiceGraphPaginator.ts @@ -0,0 +1,50 @@ +import { XRay } from "../XRay"; +import { XRayClient } from "../XRayClient"; +import { + GetServiceGraphCommand, + GetServiceGraphCommandInput, + GetServiceGraphCommandOutput, +} from "../commands/GetServiceGraphCommand"; +import { XRayPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: XRayClient, + input: GetServiceGraphCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetServiceGraphCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: XRay, + input: GetServiceGraphCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getServiceGraph(input, ...args); +}; +export async function* getServiceGraphPaginate( + config: XRayPaginationConfiguration, + input: GetServiceGraphCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetServiceGraphCommandOutput; + while (hasNext) { + input["NextToken"] = token; + if (config.client instanceof XRay) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof XRayClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected XRay | XRayClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-xray/pagination/GetTimeSeriesServiceStatisticsPaginator.ts b/clients/client-xray/pagination/GetTimeSeriesServiceStatisticsPaginator.ts new file mode 100644 index 0000000000000..4f8043ea07beb --- /dev/null +++ b/clients/client-xray/pagination/GetTimeSeriesServiceStatisticsPaginator.ts @@ -0,0 +1,50 @@ +import { XRay } from "../XRay"; +import { XRayClient } from "../XRayClient"; +import { + GetTimeSeriesServiceStatisticsCommand, + GetTimeSeriesServiceStatisticsCommandInput, + GetTimeSeriesServiceStatisticsCommandOutput, +} from "../commands/GetTimeSeriesServiceStatisticsCommand"; +import { XRayPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: XRayClient, + input: GetTimeSeriesServiceStatisticsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetTimeSeriesServiceStatisticsCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: XRay, + input: GetTimeSeriesServiceStatisticsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getTimeSeriesServiceStatistics(input, ...args); +}; +export async function* getTimeSeriesServiceStatisticsPaginate( + config: XRayPaginationConfiguration, + input: GetTimeSeriesServiceStatisticsCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetTimeSeriesServiceStatisticsCommandOutput; + while (hasNext) { + input["NextToken"] = token; + if (config.client instanceof XRay) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof XRayClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected XRay | XRayClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-xray/pagination/GetTraceGraphPaginator.ts b/clients/client-xray/pagination/GetTraceGraphPaginator.ts new file mode 100644 index 0000000000000..fdc8325a959c5 --- /dev/null +++ b/clients/client-xray/pagination/GetTraceGraphPaginator.ts @@ -0,0 +1,50 @@ +import { XRay } from "../XRay"; +import { XRayClient } from "../XRayClient"; +import { + GetTraceGraphCommand, + GetTraceGraphCommandInput, + GetTraceGraphCommandOutput, +} from "../commands/GetTraceGraphCommand"; +import { XRayPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: XRayClient, + input: GetTraceGraphCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetTraceGraphCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: XRay, + input: GetTraceGraphCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getTraceGraph(input, ...args); +}; +export async function* getTraceGraphPaginate( + config: XRayPaginationConfiguration, + input: GetTraceGraphCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetTraceGraphCommandOutput; + while (hasNext) { + input["NextToken"] = token; + if (config.client instanceof XRay) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof XRayClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected XRay | XRayClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-xray/pagination/GetTraceSummariesPaginator.ts b/clients/client-xray/pagination/GetTraceSummariesPaginator.ts new file mode 100644 index 0000000000000..d73ba876cb88a --- /dev/null +++ b/clients/client-xray/pagination/GetTraceSummariesPaginator.ts @@ -0,0 +1,50 @@ +import { XRay } from "../XRay"; +import { XRayClient } from "../XRayClient"; +import { + GetTraceSummariesCommand, + GetTraceSummariesCommandInput, + GetTraceSummariesCommandOutput, +} from "../commands/GetTraceSummariesCommand"; +import { XRayPaginationConfiguration } from "./Interfaces"; +import { Paginator } from "@aws-sdk/types"; + +const makePagedClientRequest = async ( + client: XRayClient, + input: GetTraceSummariesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new GetTraceSummariesCommand(input, ...args)); +}; +const makePagedRequest = async ( + client: XRay, + input: GetTraceSummariesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.getTraceSummaries(input, ...args); +}; +export async function* getTraceSummariesPaginate( + config: XRayPaginationConfiguration, + input: GetTraceSummariesCommandInput, + ...additionalArguments: any +): Paginator { + let token: string | undefined = config.startingToken || ""; + let hasNext = true; + let page: GetTraceSummariesCommandOutput; + while (hasNext) { + input["NextToken"] = token; + if (config.client instanceof XRay) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof XRayClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected XRay | XRayClient"); + } + yield page; + token = page["NextToken"]; + hasNext = !!token; + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-xray/pagination/Interfaces.ts b/clients/client-xray/pagination/Interfaces.ts new file mode 100644 index 0000000000000..238b8499fb168 --- /dev/null +++ b/clients/client-xray/pagination/Interfaces.ts @@ -0,0 +1,7 @@ +import { XRay } from "../XRay"; +import { XRayClient } from "../XRayClient"; +import { PaginationConfiguration } from "@aws-sdk/types"; + +export interface XRayPaginationConfiguration extends PaginationConfiguration { + client: XRay | XRayClient; +}