-
Notifications
You must be signed in to change notification settings - Fork 582
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adds client paginators (#1458)
- Loading branch information
1 parent
88baaad
commit 0c7f7ee
Showing
1,179 changed files
with
47,050 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |
51 changes: 51 additions & 0 deletions
51
clients/client-accessanalyzer/pagination/ListAnalyzedResourcesPaginator.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<ListAnalyzedResourcesCommandOutput> => { | ||
// @ts-ignore | ||
return await client.send(new ListAnalyzedResourcesCommand(input, ...args)); | ||
}; | ||
const makePagedRequest = async ( | ||
client: AccessAnalyzer, | ||
input: ListAnalyzedResourcesCommandInput, | ||
...args: any | ||
): Promise<ListAnalyzedResourcesCommandOutput> => { | ||
// @ts-ignore | ||
return await client.listAnalyzedResources(input, ...args); | ||
}; | ||
export async function* listAnalyzedResourcesPaginate( | ||
config: AccessAnalyzerPaginationConfiguration, | ||
input: ListAnalyzedResourcesCommandInput, | ||
...additionalArguments: any | ||
): Paginator<ListAnalyzedResourcesCommandOutput> { | ||
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; | ||
} |
51 changes: 51 additions & 0 deletions
51
clients/client-accessanalyzer/pagination/ListAnalyzersPaginator.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<ListAnalyzersCommandOutput> => { | ||
// @ts-ignore | ||
return await client.send(new ListAnalyzersCommand(input, ...args)); | ||
}; | ||
const makePagedRequest = async ( | ||
client: AccessAnalyzer, | ||
input: ListAnalyzersCommandInput, | ||
...args: any | ||
): Promise<ListAnalyzersCommandOutput> => { | ||
// @ts-ignore | ||
return await client.listAnalyzers(input, ...args); | ||
}; | ||
export async function* listAnalyzersPaginate( | ||
config: AccessAnalyzerPaginationConfiguration, | ||
input: ListAnalyzersCommandInput, | ||
...additionalArguments: any | ||
): Paginator<ListAnalyzersCommandOutput> { | ||
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; | ||
} |
51 changes: 51 additions & 0 deletions
51
clients/client-accessanalyzer/pagination/ListArchiveRulesPaginator.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<ListArchiveRulesCommandOutput> => { | ||
// @ts-ignore | ||
return await client.send(new ListArchiveRulesCommand(input, ...args)); | ||
}; | ||
const makePagedRequest = async ( | ||
client: AccessAnalyzer, | ||
input: ListArchiveRulesCommandInput, | ||
...args: any | ||
): Promise<ListArchiveRulesCommandOutput> => { | ||
// @ts-ignore | ||
return await client.listArchiveRules(input, ...args); | ||
}; | ||
export async function* listArchiveRulesPaginate( | ||
config: AccessAnalyzerPaginationConfiguration, | ||
input: ListArchiveRulesCommandInput, | ||
...additionalArguments: any | ||
): Paginator<ListArchiveRulesCommandOutput> { | ||
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; | ||
} |
51 changes: 51 additions & 0 deletions
51
clients/client-accessanalyzer/pagination/ListFindingsPaginator.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<ListFindingsCommandOutput> => { | ||
// @ts-ignore | ||
return await client.send(new ListFindingsCommand(input, ...args)); | ||
}; | ||
const makePagedRequest = async ( | ||
client: AccessAnalyzer, | ||
input: ListFindingsCommandInput, | ||
...args: any | ||
): Promise<ListFindingsCommandOutput> => { | ||
// @ts-ignore | ||
return await client.listFindings(input, ...args); | ||
}; | ||
export async function* listFindingsPaginate( | ||
config: AccessAnalyzerPaginationConfiguration, | ||
input: ListFindingsCommandInput, | ||
...additionalArguments: any | ||
): Paginator<ListFindingsCommandOutput> { | ||
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |
51 changes: 51 additions & 0 deletions
51
clients/client-acm-pca/pagination/ListCertificateAuthoritiesPaginator.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<ListCertificateAuthoritiesCommandOutput> => { | ||
// @ts-ignore | ||
return await client.send(new ListCertificateAuthoritiesCommand(input, ...args)); | ||
}; | ||
const makePagedRequest = async ( | ||
client: ACMPCA, | ||
input: ListCertificateAuthoritiesCommandInput, | ||
...args: any | ||
): Promise<ListCertificateAuthoritiesCommandOutput> => { | ||
// @ts-ignore | ||
return await client.listCertificateAuthorities(input, ...args); | ||
}; | ||
export async function* listCertificateAuthoritiesPaginate( | ||
config: ACMPCAPaginationConfiguration, | ||
input: ListCertificateAuthoritiesCommandInput, | ||
...additionalArguments: any | ||
): Paginator<ListCertificateAuthoritiesCommandOutput> { | ||
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; | ||
} |
51 changes: 51 additions & 0 deletions
51
clients/client-acm-pca/pagination/ListPermissionsPaginator.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<ListPermissionsCommandOutput> => { | ||
// @ts-ignore | ||
return await client.send(new ListPermissionsCommand(input, ...args)); | ||
}; | ||
const makePagedRequest = async ( | ||
client: ACMPCA, | ||
input: ListPermissionsCommandInput, | ||
...args: any | ||
): Promise<ListPermissionsCommandOutput> => { | ||
// @ts-ignore | ||
return await client.listPermissions(input, ...args); | ||
}; | ||
export async function* listPermissionsPaginate( | ||
config: ACMPCAPaginationConfiguration, | ||
input: ListPermissionsCommandInput, | ||
...additionalArguments: any | ||
): Paginator<ListPermissionsCommandOutput> { | ||
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; | ||
} |
Oops, something went wrong.