@aws-sdk/client-macie2 3.476.0 → 3.478.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/dist-cjs/pagination/DescribeBucketsPaginator.js +2 -24
  2. package/dist-cjs/pagination/GetUsageStatisticsPaginator.js +2 -24
  3. package/dist-cjs/pagination/ListAllowListsPaginator.js +2 -24
  4. package/dist-cjs/pagination/ListClassificationJobsPaginator.js +2 -24
  5. package/dist-cjs/pagination/ListClassificationScopesPaginator.js +2 -23
  6. package/dist-cjs/pagination/ListCustomDataIdentifiersPaginator.js +2 -24
  7. package/dist-cjs/pagination/ListFindingsFiltersPaginator.js +2 -24
  8. package/dist-cjs/pagination/ListFindingsPaginator.js +2 -24
  9. package/dist-cjs/pagination/ListInvitationsPaginator.js +2 -24
  10. package/dist-cjs/pagination/ListManagedDataIdentifiersPaginator.js +2 -23
  11. package/dist-cjs/pagination/ListMembersPaginator.js +2 -24
  12. package/dist-cjs/pagination/ListOrganizationAdminAccountsPaginator.js +2 -24
  13. package/dist-cjs/pagination/ListResourceProfileArtifactsPaginator.js +2 -23
  14. package/dist-cjs/pagination/ListResourceProfileDetectionsPaginator.js +2 -24
  15. package/dist-cjs/pagination/ListSensitivityInspectionTemplatesPaginator.js +2 -24
  16. package/dist-cjs/pagination/SearchResourcesPaginator.js +2 -24
  17. package/dist-cjs/protocols/Aws_restJson1.js +377 -937
  18. package/dist-es/pagination/DescribeBucketsPaginator.js +2 -23
  19. package/dist-es/pagination/GetUsageStatisticsPaginator.js +2 -23
  20. package/dist-es/pagination/ListAllowListsPaginator.js +2 -23
  21. package/dist-es/pagination/ListClassificationJobsPaginator.js +2 -23
  22. package/dist-es/pagination/ListClassificationScopesPaginator.js +2 -22
  23. package/dist-es/pagination/ListCustomDataIdentifiersPaginator.js +2 -23
  24. package/dist-es/pagination/ListFindingsFiltersPaginator.js +2 -23
  25. package/dist-es/pagination/ListFindingsPaginator.js +2 -23
  26. package/dist-es/pagination/ListInvitationsPaginator.js +2 -23
  27. package/dist-es/pagination/ListManagedDataIdentifiersPaginator.js +2 -22
  28. package/dist-es/pagination/ListMembersPaginator.js +2 -23
  29. package/dist-es/pagination/ListOrganizationAdminAccountsPaginator.js +2 -23
  30. package/dist-es/pagination/ListResourceProfileArtifactsPaginator.js +2 -22
  31. package/dist-es/pagination/ListResourceProfileDetectionsPaginator.js +2 -23
  32. package/dist-es/pagination/ListSensitivityInspectionTemplatesPaginator.js +2 -23
  33. package/dist-es/pagination/SearchResourcesPaginator.js +2 -23
  34. package/dist-es/protocols/Aws_restJson1.js +378 -938
  35. package/dist-types/pagination/DescribeBucketsPaginator.d.ts +1 -1
  36. package/dist-types/pagination/GetUsageStatisticsPaginator.d.ts +1 -1
  37. package/dist-types/pagination/ListAllowListsPaginator.d.ts +1 -1
  38. package/dist-types/pagination/ListClassificationJobsPaginator.d.ts +1 -1
  39. package/dist-types/pagination/ListClassificationScopesPaginator.d.ts +1 -1
  40. package/dist-types/pagination/ListCustomDataIdentifiersPaginator.d.ts +1 -1
  41. package/dist-types/pagination/ListFindingsFiltersPaginator.d.ts +1 -1
  42. package/dist-types/pagination/ListFindingsPaginator.d.ts +1 -1
  43. package/dist-types/pagination/ListInvitationsPaginator.d.ts +1 -1
  44. package/dist-types/pagination/ListManagedDataIdentifiersPaginator.d.ts +1 -1
  45. package/dist-types/pagination/ListMembersPaginator.d.ts +1 -1
  46. package/dist-types/pagination/ListOrganizationAdminAccountsPaginator.d.ts +1 -1
  47. package/dist-types/pagination/ListResourceProfileArtifactsPaginator.d.ts +1 -1
  48. package/dist-types/pagination/ListResourceProfileDetectionsPaginator.d.ts +1 -1
  49. package/dist-types/pagination/ListSensitivityInspectionTemplatesPaginator.d.ts +1 -1
  50. package/dist-types/pagination/SearchResourcesPaginator.d.ts +1 -1
  51. package/dist-types/ts3.4/pagination/DescribeBucketsPaginator.d.ts +3 -3
  52. package/dist-types/ts3.4/pagination/GetUsageStatisticsPaginator.d.ts +3 -3
  53. package/dist-types/ts3.4/pagination/ListAllowListsPaginator.d.ts +3 -3
  54. package/dist-types/ts3.4/pagination/ListClassificationJobsPaginator.d.ts +3 -3
  55. package/dist-types/ts3.4/pagination/ListClassificationScopesPaginator.d.ts +3 -3
  56. package/dist-types/ts3.4/pagination/ListCustomDataIdentifiersPaginator.d.ts +3 -3
  57. package/dist-types/ts3.4/pagination/ListFindingsFiltersPaginator.d.ts +3 -3
  58. package/dist-types/ts3.4/pagination/ListFindingsPaginator.d.ts +3 -3
  59. package/dist-types/ts3.4/pagination/ListInvitationsPaginator.d.ts +3 -3
  60. package/dist-types/ts3.4/pagination/ListManagedDataIdentifiersPaginator.d.ts +3 -3
  61. package/dist-types/ts3.4/pagination/ListMembersPaginator.d.ts +3 -3
  62. package/dist-types/ts3.4/pagination/ListOrganizationAdminAccountsPaginator.d.ts +3 -3
  63. package/dist-types/ts3.4/pagination/ListResourceProfileArtifactsPaginator.d.ts +3 -3
  64. package/dist-types/ts3.4/pagination/ListResourceProfileDetectionsPaginator.d.ts +3 -3
  65. package/dist-types/ts3.4/pagination/ListSensitivityInspectionTemplatesPaginator.d.ts +3 -3
  66. package/dist-types/ts3.4/pagination/SearchResourcesPaginator.d.ts +3 -3
  67. package/package.json +7 -6
@@ -1,25 +1,4 @@
1
+ import { createPaginator } from "@smithy/core";
1
2
  import { DescribeBucketsCommand, } from "../commands/DescribeBucketsCommand";
2
3
  import { Macie2Client } from "../Macie2Client";
3
- const makePagedClientRequest = async (client, input, ...args) => {
4
- return await client.send(new DescribeBucketsCommand(input), ...args);
5
- };
6
- export async function* paginateDescribeBuckets(config, input, ...additionalArguments) {
7
- let token = config.startingToken || undefined;
8
- let hasNext = true;
9
- let page;
10
- while (hasNext) {
11
- input.nextToken = token;
12
- input["maxResults"] = config.pageSize;
13
- if (config.client instanceof Macie2Client) {
14
- page = await makePagedClientRequest(config.client, input, ...additionalArguments);
15
- }
16
- else {
17
- throw new Error("Invalid client, expected Macie2 | Macie2Client");
18
- }
19
- yield page;
20
- const prevToken = token;
21
- token = page.nextToken;
22
- hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
23
- }
24
- return undefined;
25
- }
4
+ export const paginateDescribeBuckets = createPaginator(Macie2Client, DescribeBucketsCommand, "nextToken", "nextToken", "maxResults");
@@ -1,25 +1,4 @@
1
+ import { createPaginator } from "@smithy/core";
1
2
  import { GetUsageStatisticsCommand, } from "../commands/GetUsageStatisticsCommand";
2
3
  import { Macie2Client } from "../Macie2Client";
3
- const makePagedClientRequest = async (client, input, ...args) => {
4
- return await client.send(new GetUsageStatisticsCommand(input), ...args);
5
- };
6
- export async function* paginateGetUsageStatistics(config, input, ...additionalArguments) {
7
- let token = config.startingToken || undefined;
8
- let hasNext = true;
9
- let page;
10
- while (hasNext) {
11
- input.nextToken = token;
12
- input["maxResults"] = config.pageSize;
13
- if (config.client instanceof Macie2Client) {
14
- page = await makePagedClientRequest(config.client, input, ...additionalArguments);
15
- }
16
- else {
17
- throw new Error("Invalid client, expected Macie2 | Macie2Client");
18
- }
19
- yield page;
20
- const prevToken = token;
21
- token = page.nextToken;
22
- hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
23
- }
24
- return undefined;
25
- }
4
+ export const paginateGetUsageStatistics = createPaginator(Macie2Client, GetUsageStatisticsCommand, "nextToken", "nextToken", "maxResults");
@@ -1,25 +1,4 @@
1
+ import { createPaginator } from "@smithy/core";
1
2
  import { ListAllowListsCommand, } from "../commands/ListAllowListsCommand";
2
3
  import { Macie2Client } from "../Macie2Client";
3
- const makePagedClientRequest = async (client, input, ...args) => {
4
- return await client.send(new ListAllowListsCommand(input), ...args);
5
- };
6
- export async function* paginateListAllowLists(config, input, ...additionalArguments) {
7
- let token = config.startingToken || undefined;
8
- let hasNext = true;
9
- let page;
10
- while (hasNext) {
11
- input.nextToken = token;
12
- input["maxResults"] = config.pageSize;
13
- if (config.client instanceof Macie2Client) {
14
- page = await makePagedClientRequest(config.client, input, ...additionalArguments);
15
- }
16
- else {
17
- throw new Error("Invalid client, expected Macie2 | Macie2Client");
18
- }
19
- yield page;
20
- const prevToken = token;
21
- token = page.nextToken;
22
- hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
23
- }
24
- return undefined;
25
- }
4
+ export const paginateListAllowLists = createPaginator(Macie2Client, ListAllowListsCommand, "nextToken", "nextToken", "maxResults");
@@ -1,25 +1,4 @@
1
+ import { createPaginator } from "@smithy/core";
1
2
  import { ListClassificationJobsCommand, } from "../commands/ListClassificationJobsCommand";
2
3
  import { Macie2Client } from "../Macie2Client";
3
- const makePagedClientRequest = async (client, input, ...args) => {
4
- return await client.send(new ListClassificationJobsCommand(input), ...args);
5
- };
6
- export async function* paginateListClassificationJobs(config, input, ...additionalArguments) {
7
- let token = config.startingToken || undefined;
8
- let hasNext = true;
9
- let page;
10
- while (hasNext) {
11
- input.nextToken = token;
12
- input["maxResults"] = config.pageSize;
13
- if (config.client instanceof Macie2Client) {
14
- page = await makePagedClientRequest(config.client, input, ...additionalArguments);
15
- }
16
- else {
17
- throw new Error("Invalid client, expected Macie2 | Macie2Client");
18
- }
19
- yield page;
20
- const prevToken = token;
21
- token = page.nextToken;
22
- hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
23
- }
24
- return undefined;
25
- }
4
+ export const paginateListClassificationJobs = createPaginator(Macie2Client, ListClassificationJobsCommand, "nextToken", "nextToken", "maxResults");
@@ -1,24 +1,4 @@
1
+ import { createPaginator } from "@smithy/core";
1
2
  import { ListClassificationScopesCommand, } from "../commands/ListClassificationScopesCommand";
2
3
  import { Macie2Client } from "../Macie2Client";
3
- const makePagedClientRequest = async (client, input, ...args) => {
4
- return await client.send(new ListClassificationScopesCommand(input), ...args);
5
- };
6
- export async function* paginateListClassificationScopes(config, input, ...additionalArguments) {
7
- let token = config.startingToken || undefined;
8
- let hasNext = true;
9
- let page;
10
- while (hasNext) {
11
- input.nextToken = token;
12
- if (config.client instanceof Macie2Client) {
13
- page = await makePagedClientRequest(config.client, input, ...additionalArguments);
14
- }
15
- else {
16
- throw new Error("Invalid client, expected Macie2 | Macie2Client");
17
- }
18
- yield page;
19
- const prevToken = token;
20
- token = page.nextToken;
21
- hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
22
- }
23
- return undefined;
24
- }
4
+ export const paginateListClassificationScopes = createPaginator(Macie2Client, ListClassificationScopesCommand, "nextToken", "nextToken", "");
@@ -1,25 +1,4 @@
1
+ import { createPaginator } from "@smithy/core";
1
2
  import { ListCustomDataIdentifiersCommand, } from "../commands/ListCustomDataIdentifiersCommand";
2
3
  import { Macie2Client } from "../Macie2Client";
3
- const makePagedClientRequest = async (client, input, ...args) => {
4
- return await client.send(new ListCustomDataIdentifiersCommand(input), ...args);
5
- };
6
- export async function* paginateListCustomDataIdentifiers(config, input, ...additionalArguments) {
7
- let token = config.startingToken || undefined;
8
- let hasNext = true;
9
- let page;
10
- while (hasNext) {
11
- input.nextToken = token;
12
- input["maxResults"] = config.pageSize;
13
- if (config.client instanceof Macie2Client) {
14
- page = await makePagedClientRequest(config.client, input, ...additionalArguments);
15
- }
16
- else {
17
- throw new Error("Invalid client, expected Macie2 | Macie2Client");
18
- }
19
- yield page;
20
- const prevToken = token;
21
- token = page.nextToken;
22
- hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
23
- }
24
- return undefined;
25
- }
4
+ export const paginateListCustomDataIdentifiers = createPaginator(Macie2Client, ListCustomDataIdentifiersCommand, "nextToken", "nextToken", "maxResults");
@@ -1,25 +1,4 @@
1
+ import { createPaginator } from "@smithy/core";
1
2
  import { ListFindingsFiltersCommand, } from "../commands/ListFindingsFiltersCommand";
2
3
  import { Macie2Client } from "../Macie2Client";
3
- const makePagedClientRequest = async (client, input, ...args) => {
4
- return await client.send(new ListFindingsFiltersCommand(input), ...args);
5
- };
6
- export async function* paginateListFindingsFilters(config, input, ...additionalArguments) {
7
- let token = config.startingToken || undefined;
8
- let hasNext = true;
9
- let page;
10
- while (hasNext) {
11
- input.nextToken = token;
12
- input["maxResults"] = config.pageSize;
13
- if (config.client instanceof Macie2Client) {
14
- page = await makePagedClientRequest(config.client, input, ...additionalArguments);
15
- }
16
- else {
17
- throw new Error("Invalid client, expected Macie2 | Macie2Client");
18
- }
19
- yield page;
20
- const prevToken = token;
21
- token = page.nextToken;
22
- hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
23
- }
24
- return undefined;
25
- }
4
+ export const paginateListFindingsFilters = createPaginator(Macie2Client, ListFindingsFiltersCommand, "nextToken", "nextToken", "maxResults");
@@ -1,25 +1,4 @@
1
+ import { createPaginator } from "@smithy/core";
1
2
  import { ListFindingsCommand, } from "../commands/ListFindingsCommand";
2
3
  import { Macie2Client } from "../Macie2Client";
3
- const makePagedClientRequest = async (client, input, ...args) => {
4
- return await client.send(new ListFindingsCommand(input), ...args);
5
- };
6
- export async function* paginateListFindings(config, input, ...additionalArguments) {
7
- let token = config.startingToken || undefined;
8
- let hasNext = true;
9
- let page;
10
- while (hasNext) {
11
- input.nextToken = token;
12
- input["maxResults"] = config.pageSize;
13
- if (config.client instanceof Macie2Client) {
14
- page = await makePagedClientRequest(config.client, input, ...additionalArguments);
15
- }
16
- else {
17
- throw new Error("Invalid client, expected Macie2 | Macie2Client");
18
- }
19
- yield page;
20
- const prevToken = token;
21
- token = page.nextToken;
22
- hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
23
- }
24
- return undefined;
25
- }
4
+ export const paginateListFindings = createPaginator(Macie2Client, ListFindingsCommand, "nextToken", "nextToken", "maxResults");
@@ -1,25 +1,4 @@
1
+ import { createPaginator } from "@smithy/core";
1
2
  import { ListInvitationsCommand, } from "../commands/ListInvitationsCommand";
2
3
  import { Macie2Client } from "../Macie2Client";
3
- const makePagedClientRequest = async (client, input, ...args) => {
4
- return await client.send(new ListInvitationsCommand(input), ...args);
5
- };
6
- export async function* paginateListInvitations(config, input, ...additionalArguments) {
7
- let token = config.startingToken || undefined;
8
- let hasNext = true;
9
- let page;
10
- while (hasNext) {
11
- input.nextToken = token;
12
- input["maxResults"] = config.pageSize;
13
- if (config.client instanceof Macie2Client) {
14
- page = await makePagedClientRequest(config.client, input, ...additionalArguments);
15
- }
16
- else {
17
- throw new Error("Invalid client, expected Macie2 | Macie2Client");
18
- }
19
- yield page;
20
- const prevToken = token;
21
- token = page.nextToken;
22
- hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
23
- }
24
- return undefined;
25
- }
4
+ export const paginateListInvitations = createPaginator(Macie2Client, ListInvitationsCommand, "nextToken", "nextToken", "maxResults");
@@ -1,24 +1,4 @@
1
+ import { createPaginator } from "@smithy/core";
1
2
  import { ListManagedDataIdentifiersCommand, } from "../commands/ListManagedDataIdentifiersCommand";
2
3
  import { Macie2Client } from "../Macie2Client";
3
- const makePagedClientRequest = async (client, input, ...args) => {
4
- return await client.send(new ListManagedDataIdentifiersCommand(input), ...args);
5
- };
6
- export async function* paginateListManagedDataIdentifiers(config, input, ...additionalArguments) {
7
- let token = config.startingToken || undefined;
8
- let hasNext = true;
9
- let page;
10
- while (hasNext) {
11
- input.nextToken = token;
12
- if (config.client instanceof Macie2Client) {
13
- page = await makePagedClientRequest(config.client, input, ...additionalArguments);
14
- }
15
- else {
16
- throw new Error("Invalid client, expected Macie2 | Macie2Client");
17
- }
18
- yield page;
19
- const prevToken = token;
20
- token = page.nextToken;
21
- hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
22
- }
23
- return undefined;
24
- }
4
+ export const paginateListManagedDataIdentifiers = createPaginator(Macie2Client, ListManagedDataIdentifiersCommand, "nextToken", "nextToken", "");
@@ -1,25 +1,4 @@
1
+ import { createPaginator } from "@smithy/core";
1
2
  import { ListMembersCommand } from "../commands/ListMembersCommand";
2
3
  import { Macie2Client } from "../Macie2Client";
3
- const makePagedClientRequest = async (client, input, ...args) => {
4
- return await client.send(new ListMembersCommand(input), ...args);
5
- };
6
- export async function* paginateListMembers(config, input, ...additionalArguments) {
7
- let token = config.startingToken || undefined;
8
- let hasNext = true;
9
- let page;
10
- while (hasNext) {
11
- input.nextToken = token;
12
- input["maxResults"] = config.pageSize;
13
- if (config.client instanceof Macie2Client) {
14
- page = await makePagedClientRequest(config.client, input, ...additionalArguments);
15
- }
16
- else {
17
- throw new Error("Invalid client, expected Macie2 | Macie2Client");
18
- }
19
- yield page;
20
- const prevToken = token;
21
- token = page.nextToken;
22
- hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
23
- }
24
- return undefined;
25
- }
4
+ export const paginateListMembers = createPaginator(Macie2Client, ListMembersCommand, "nextToken", "nextToken", "maxResults");
@@ -1,25 +1,4 @@
1
+ import { createPaginator } from "@smithy/core";
1
2
  import { ListOrganizationAdminAccountsCommand, } from "../commands/ListOrganizationAdminAccountsCommand";
2
3
  import { Macie2Client } from "../Macie2Client";
3
- const makePagedClientRequest = async (client, input, ...args) => {
4
- return await client.send(new ListOrganizationAdminAccountsCommand(input), ...args);
5
- };
6
- export async function* paginateListOrganizationAdminAccounts(config, input, ...additionalArguments) {
7
- let token = config.startingToken || undefined;
8
- let hasNext = true;
9
- let page;
10
- while (hasNext) {
11
- input.nextToken = token;
12
- input["maxResults"] = config.pageSize;
13
- if (config.client instanceof Macie2Client) {
14
- page = await makePagedClientRequest(config.client, input, ...additionalArguments);
15
- }
16
- else {
17
- throw new Error("Invalid client, expected Macie2 | Macie2Client");
18
- }
19
- yield page;
20
- const prevToken = token;
21
- token = page.nextToken;
22
- hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
23
- }
24
- return undefined;
25
- }
4
+ export const paginateListOrganizationAdminAccounts = createPaginator(Macie2Client, ListOrganizationAdminAccountsCommand, "nextToken", "nextToken", "maxResults");
@@ -1,24 +1,4 @@
1
+ import { createPaginator } from "@smithy/core";
1
2
  import { ListResourceProfileArtifactsCommand, } from "../commands/ListResourceProfileArtifactsCommand";
2
3
  import { Macie2Client } from "../Macie2Client";
3
- const makePagedClientRequest = async (client, input, ...args) => {
4
- return await client.send(new ListResourceProfileArtifactsCommand(input), ...args);
5
- };
6
- export async function* paginateListResourceProfileArtifacts(config, input, ...additionalArguments) {
7
- let token = config.startingToken || undefined;
8
- let hasNext = true;
9
- let page;
10
- while (hasNext) {
11
- input.nextToken = token;
12
- if (config.client instanceof Macie2Client) {
13
- page = await makePagedClientRequest(config.client, input, ...additionalArguments);
14
- }
15
- else {
16
- throw new Error("Invalid client, expected Macie2 | Macie2Client");
17
- }
18
- yield page;
19
- const prevToken = token;
20
- token = page.nextToken;
21
- hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
22
- }
23
- return undefined;
24
- }
4
+ export const paginateListResourceProfileArtifacts = createPaginator(Macie2Client, ListResourceProfileArtifactsCommand, "nextToken", "nextToken", "");
@@ -1,25 +1,4 @@
1
+ import { createPaginator } from "@smithy/core";
1
2
  import { ListResourceProfileDetectionsCommand, } from "../commands/ListResourceProfileDetectionsCommand";
2
3
  import { Macie2Client } from "../Macie2Client";
3
- const makePagedClientRequest = async (client, input, ...args) => {
4
- return await client.send(new ListResourceProfileDetectionsCommand(input), ...args);
5
- };
6
- export async function* paginateListResourceProfileDetections(config, input, ...additionalArguments) {
7
- let token = config.startingToken || undefined;
8
- let hasNext = true;
9
- let page;
10
- while (hasNext) {
11
- input.nextToken = token;
12
- input["maxResults"] = config.pageSize;
13
- if (config.client instanceof Macie2Client) {
14
- page = await makePagedClientRequest(config.client, input, ...additionalArguments);
15
- }
16
- else {
17
- throw new Error("Invalid client, expected Macie2 | Macie2Client");
18
- }
19
- yield page;
20
- const prevToken = token;
21
- token = page.nextToken;
22
- hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
23
- }
24
- return undefined;
25
- }
4
+ export const paginateListResourceProfileDetections = createPaginator(Macie2Client, ListResourceProfileDetectionsCommand, "nextToken", "nextToken", "maxResults");
@@ -1,25 +1,4 @@
1
+ import { createPaginator } from "@smithy/core";
1
2
  import { ListSensitivityInspectionTemplatesCommand, } from "../commands/ListSensitivityInspectionTemplatesCommand";
2
3
  import { Macie2Client } from "../Macie2Client";
3
- const makePagedClientRequest = async (client, input, ...args) => {
4
- return await client.send(new ListSensitivityInspectionTemplatesCommand(input), ...args);
5
- };
6
- export async function* paginateListSensitivityInspectionTemplates(config, input, ...additionalArguments) {
7
- let token = config.startingToken || undefined;
8
- let hasNext = true;
9
- let page;
10
- while (hasNext) {
11
- input.nextToken = token;
12
- input["maxResults"] = config.pageSize;
13
- if (config.client instanceof Macie2Client) {
14
- page = await makePagedClientRequest(config.client, input, ...additionalArguments);
15
- }
16
- else {
17
- throw new Error("Invalid client, expected Macie2 | Macie2Client");
18
- }
19
- yield page;
20
- const prevToken = token;
21
- token = page.nextToken;
22
- hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
23
- }
24
- return undefined;
25
- }
4
+ export const paginateListSensitivityInspectionTemplates = createPaginator(Macie2Client, ListSensitivityInspectionTemplatesCommand, "nextToken", "nextToken", "maxResults");
@@ -1,25 +1,4 @@
1
+ import { createPaginator } from "@smithy/core";
1
2
  import { SearchResourcesCommand, } from "../commands/SearchResourcesCommand";
2
3
  import { Macie2Client } from "../Macie2Client";
3
- const makePagedClientRequest = async (client, input, ...args) => {
4
- return await client.send(new SearchResourcesCommand(input), ...args);
5
- };
6
- export async function* paginateSearchResources(config, input, ...additionalArguments) {
7
- let token = config.startingToken || undefined;
8
- let hasNext = true;
9
- let page;
10
- while (hasNext) {
11
- input.nextToken = token;
12
- input["maxResults"] = config.pageSize;
13
- if (config.client instanceof Macie2Client) {
14
- page = await makePagedClientRequest(config.client, input, ...additionalArguments);
15
- }
16
- else {
17
- throw new Error("Invalid client, expected Macie2 | Macie2Client");
18
- }
19
- yield page;
20
- const prevToken = token;
21
- token = page.nextToken;
22
- hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
23
- }
24
- return undefined;
25
- }
4
+ export const paginateSearchResources = createPaginator(Macie2Client, SearchResourcesCommand, "nextToken", "nextToken", "maxResults");