Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

fix(clients): remove aggregated client from paginators #4496

Merged
merged 2 commits into from Mar 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
@@ -1,9 +1,8 @@
// smithy-typescript generated code
import { PaginationConfiguration } from "@aws-sdk/types";

import { AccessAnalyzer } from "../AccessAnalyzer";
import { AccessAnalyzerClient } from "../AccessAnalyzerClient";

export interface AccessAnalyzerPaginationConfiguration extends PaginationConfiguration {
client: AccessAnalyzer | AccessAnalyzerClient;
client: AccessAnalyzerClient;
}
@@ -1,7 +1,6 @@
// smithy-typescript generated code
import { Paginator } from "@aws-sdk/types";

import { AccessAnalyzer } from "../AccessAnalyzer";
import { AccessAnalyzerClient } from "../AccessAnalyzerClient";
import {
ListAccessPreviewFindingsCommand,
Expand All @@ -21,17 +20,6 @@ const makePagedClientRequest = async (
// @ts-ignore
return await client.send(new ListAccessPreviewFindingsCommand(input), ...args);
};
/**
* @private
*/
const makePagedRequest = async (
client: AccessAnalyzer,
input: ListAccessPreviewFindingsCommandInput,
...args: any
): Promise<ListAccessPreviewFindingsCommandOutput> => {
// @ts-ignore
return await client.listAccessPreviewFindings(input, ...args);
};
export async function* paginateListAccessPreviewFindings(
config: AccessAnalyzerPaginationConfiguration,
input: ListAccessPreviewFindingsCommandInput,
Expand All @@ -44,9 +32,7 @@ export async function* paginateListAccessPreviewFindings(
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) {
if (config.client instanceof AccessAnalyzerClient) {
page = await makePagedClientRequest(config.client, input, ...additionalArguments);
} else {
throw new Error("Invalid client, expected AccessAnalyzer | AccessAnalyzerClient");
Expand Down
@@ -1,7 +1,6 @@
// smithy-typescript generated code
import { Paginator } from "@aws-sdk/types";

import { AccessAnalyzer } from "../AccessAnalyzer";
import { AccessAnalyzerClient } from "../AccessAnalyzerClient";
import {
ListAccessPreviewsCommand,
Expand All @@ -21,17 +20,6 @@ const makePagedClientRequest = async (
// @ts-ignore
return await client.send(new ListAccessPreviewsCommand(input), ...args);
};
/**
* @private
*/
const makePagedRequest = async (
client: AccessAnalyzer,
input: ListAccessPreviewsCommandInput,
...args: any
): Promise<ListAccessPreviewsCommandOutput> => {
// @ts-ignore
return await client.listAccessPreviews(input, ...args);
};
export async function* paginateListAccessPreviews(
config: AccessAnalyzerPaginationConfiguration,
input: ListAccessPreviewsCommandInput,
Expand All @@ -44,9 +32,7 @@ export async function* paginateListAccessPreviews(
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) {
if (config.client instanceof AccessAnalyzerClient) {
page = await makePagedClientRequest(config.client, input, ...additionalArguments);
} else {
throw new Error("Invalid client, expected AccessAnalyzer | AccessAnalyzerClient");
Expand Down
@@ -1,7 +1,6 @@
// smithy-typescript generated code
import { Paginator } from "@aws-sdk/types";

import { AccessAnalyzer } from "../AccessAnalyzer";
import { AccessAnalyzerClient } from "../AccessAnalyzerClient";
import {
ListAnalyzedResourcesCommand,
Expand All @@ -21,17 +20,6 @@ const makePagedClientRequest = async (
// @ts-ignore
return await client.send(new ListAnalyzedResourcesCommand(input), ...args);
};
/**
* @private
*/
const makePagedRequest = async (
client: AccessAnalyzer,
input: ListAnalyzedResourcesCommandInput,
...args: any
): Promise<ListAnalyzedResourcesCommandOutput> => {
// @ts-ignore
return await client.listAnalyzedResources(input, ...args);
};
export async function* paginateListAnalyzedResources(
config: AccessAnalyzerPaginationConfiguration,
input: ListAnalyzedResourcesCommandInput,
Expand All @@ -44,9 +32,7 @@ export async function* paginateListAnalyzedResources(
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) {
if (config.client instanceof AccessAnalyzerClient) {
page = await makePagedClientRequest(config.client, input, ...additionalArguments);
} else {
throw new Error("Invalid client, expected AccessAnalyzer | AccessAnalyzerClient");
Expand Down
@@ -1,7 +1,6 @@
// smithy-typescript generated code
import { Paginator } from "@aws-sdk/types";

import { AccessAnalyzer } from "../AccessAnalyzer";
import { AccessAnalyzerClient } from "../AccessAnalyzerClient";
import {
ListAnalyzersCommand,
Expand All @@ -21,17 +20,6 @@ const makePagedClientRequest = async (
// @ts-ignore
return await client.send(new ListAnalyzersCommand(input), ...args);
};
/**
* @private
*/
const makePagedRequest = async (
client: AccessAnalyzer,
input: ListAnalyzersCommandInput,
...args: any
): Promise<ListAnalyzersCommandOutput> => {
// @ts-ignore
return await client.listAnalyzers(input, ...args);
};
export async function* paginateListAnalyzers(
config: AccessAnalyzerPaginationConfiguration,
input: ListAnalyzersCommandInput,
Expand All @@ -44,9 +32,7 @@ export async function* paginateListAnalyzers(
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) {
if (config.client instanceof AccessAnalyzerClient) {
page = await makePagedClientRequest(config.client, input, ...additionalArguments);
} else {
throw new Error("Invalid client, expected AccessAnalyzer | AccessAnalyzerClient");
Expand Down
@@ -1,7 +1,6 @@
// smithy-typescript generated code
import { Paginator } from "@aws-sdk/types";

import { AccessAnalyzer } from "../AccessAnalyzer";
import { AccessAnalyzerClient } from "../AccessAnalyzerClient";
import {
ListArchiveRulesCommand,
Expand All @@ -21,17 +20,6 @@ const makePagedClientRequest = async (
// @ts-ignore
return await client.send(new ListArchiveRulesCommand(input), ...args);
};
/**
* @private
*/
const makePagedRequest = async (
client: AccessAnalyzer,
input: ListArchiveRulesCommandInput,
...args: any
): Promise<ListArchiveRulesCommandOutput> => {
// @ts-ignore
return await client.listArchiveRules(input, ...args);
};
export async function* paginateListArchiveRules(
config: AccessAnalyzerPaginationConfiguration,
input: ListArchiveRulesCommandInput,
Expand All @@ -44,9 +32,7 @@ export async function* paginateListArchiveRules(
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) {
if (config.client instanceof AccessAnalyzerClient) {
page = await makePagedClientRequest(config.client, input, ...additionalArguments);
} else {
throw new Error("Invalid client, expected AccessAnalyzer | AccessAnalyzerClient");
Expand Down
@@ -1,7 +1,6 @@
// smithy-typescript generated code
import { Paginator } from "@aws-sdk/types";

import { AccessAnalyzer } from "../AccessAnalyzer";
import { AccessAnalyzerClient } from "../AccessAnalyzerClient";
import {
ListFindingsCommand,
Expand All @@ -21,17 +20,6 @@ const makePagedClientRequest = async (
// @ts-ignore
return await client.send(new ListFindingsCommand(input), ...args);
};
/**
* @private
*/
const makePagedRequest = async (
client: AccessAnalyzer,
input: ListFindingsCommandInput,
...args: any
): Promise<ListFindingsCommandOutput> => {
// @ts-ignore
return await client.listFindings(input, ...args);
};
export async function* paginateListFindings(
config: AccessAnalyzerPaginationConfiguration,
input: ListFindingsCommandInput,
Expand All @@ -44,9 +32,7 @@ export async function* paginateListFindings(
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) {
if (config.client instanceof AccessAnalyzerClient) {
page = await makePagedClientRequest(config.client, input, ...additionalArguments);
} else {
throw new Error("Invalid client, expected AccessAnalyzer | AccessAnalyzerClient");
Expand Down
@@ -1,7 +1,6 @@
// smithy-typescript generated code
import { Paginator } from "@aws-sdk/types";

import { AccessAnalyzer } from "../AccessAnalyzer";
import { AccessAnalyzerClient } from "../AccessAnalyzerClient";
import {
ListPolicyGenerationsCommand,
Expand All @@ -21,17 +20,6 @@ const makePagedClientRequest = async (
// @ts-ignore
return await client.send(new ListPolicyGenerationsCommand(input), ...args);
};
/**
* @private
*/
const makePagedRequest = async (
client: AccessAnalyzer,
input: ListPolicyGenerationsCommandInput,
...args: any
): Promise<ListPolicyGenerationsCommandOutput> => {
// @ts-ignore
return await client.listPolicyGenerations(input, ...args);
};
export async function* paginateListPolicyGenerations(
config: AccessAnalyzerPaginationConfiguration,
input: ListPolicyGenerationsCommandInput,
Expand All @@ -44,9 +32,7 @@ export async function* paginateListPolicyGenerations(
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) {
if (config.client instanceof AccessAnalyzerClient) {
page = await makePagedClientRequest(config.client, input, ...additionalArguments);
} else {
throw new Error("Invalid client, expected AccessAnalyzer | AccessAnalyzerClient");
Expand Down
@@ -1,7 +1,6 @@
// smithy-typescript generated code
import { Paginator } from "@aws-sdk/types";

import { AccessAnalyzer } from "../AccessAnalyzer";
import { AccessAnalyzerClient } from "../AccessAnalyzerClient";
import {
ValidatePolicyCommand,
Expand All @@ -21,17 +20,6 @@ const makePagedClientRequest = async (
// @ts-ignore
return await client.send(new ValidatePolicyCommand(input), ...args);
};
/**
* @private
*/
const makePagedRequest = async (
client: AccessAnalyzer,
input: ValidatePolicyCommandInput,
...args: any
): Promise<ValidatePolicyCommandOutput> => {
// @ts-ignore
return await client.validatePolicy(input, ...args);
};
export async function* paginateValidatePolicy(
config: AccessAnalyzerPaginationConfiguration,
input: ValidatePolicyCommandInput,
Expand All @@ -44,9 +32,7 @@ export async function* paginateValidatePolicy(
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) {
if (config.client instanceof AccessAnalyzerClient) {
page = await makePagedClientRequest(config.client, input, ...additionalArguments);
} else {
throw new Error("Invalid client, expected AccessAnalyzer | AccessAnalyzerClient");
Expand Down
3 changes: 1 addition & 2 deletions clients/client-account/src/pagination/Interfaces.ts
@@ -1,9 +1,8 @@
// smithy-typescript generated code
import { PaginationConfiguration } from "@aws-sdk/types";

import { Account } from "../Account";
import { AccountClient } from "../AccountClient";

export interface AccountPaginationConfiguration extends PaginationConfiguration {
client: Account | AccountClient;
client: AccountClient;
}
16 changes: 1 addition & 15 deletions clients/client-account/src/pagination/ListRegionsPaginator.ts
@@ -1,7 +1,6 @@
// smithy-typescript generated code
import { Paginator } from "@aws-sdk/types";

import { Account } from "../Account";
import { AccountClient } from "../AccountClient";
import { ListRegionsCommand, ListRegionsCommandInput, ListRegionsCommandOutput } from "../commands/ListRegionsCommand";
import { AccountPaginationConfiguration } from "./Interfaces";
Expand All @@ -17,17 +16,6 @@ const makePagedClientRequest = async (
// @ts-ignore
return await client.send(new ListRegionsCommand(input), ...args);
};
/**
* @private
*/
const makePagedRequest = async (
client: Account,
input: ListRegionsCommandInput,
...args: any
): Promise<ListRegionsCommandOutput> => {
// @ts-ignore
return await client.listRegions(input, ...args);
};
export async function* paginateListRegions(
config: AccountPaginationConfiguration,
input: ListRegionsCommandInput,
Expand All @@ -40,9 +28,7 @@ export async function* paginateListRegions(
while (hasNext) {
input.NextToken = token;
input["MaxResults"] = config.pageSize;
if (config.client instanceof Account) {
page = await makePagedRequest(config.client, input, ...additionalArguments);
} else if (config.client instanceof AccountClient) {
if (config.client instanceof AccountClient) {
page = await makePagedClientRequest(config.client, input, ...additionalArguments);
} else {
throw new Error("Invalid client, expected Account | AccountClient");
Expand Down
3 changes: 1 addition & 2 deletions clients/client-acm-pca/src/pagination/Interfaces.ts
@@ -1,9 +1,8 @@
// smithy-typescript generated code
import { PaginationConfiguration } from "@aws-sdk/types";

import { ACMPCA } from "../ACMPCA";
import { ACMPCAClient } from "../ACMPCAClient";

export interface ACMPCAPaginationConfiguration extends PaginationConfiguration {
client: ACMPCA | ACMPCAClient;
client: ACMPCAClient;
}